We *do* know for sure it's a PDF document, so let's set the MIME type ourself.
In the process, we also add "Title" and "Creator" attributes to PDF files generated. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14507 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -232,7 +232,7 @@ PDFWriter::EndJob()
|
||||
}
|
||||
#endif
|
||||
fImageCache.Flush();
|
||||
|
||||
|
||||
PDF_close(fPdf);
|
||||
REPORT(kDebug, 0, ">>>> PDF_close");
|
||||
|
||||
@@ -247,9 +247,13 @@ PDFWriter::EndJob()
|
||||
// --------------------------------------------------
|
||||
void
|
||||
PDFWriter::SetAttribute(const char* name, const char* value) {
|
||||
BFile* file = dynamic_cast<BFile*>(Transport());
|
||||
|
||||
if (!name || !value)
|
||||
return;
|
||||
|
||||
BFile * file = dynamic_cast<BFile *>(Transport());
|
||||
if (file) {
|
||||
|
||||
file->WriteAttr(name, B_STRING_TYPE, 0, value, strlen(value) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +268,9 @@ PDFWriter::InitWriter()
|
||||
fState = NULL;
|
||||
fStateDepth = 0;
|
||||
|
||||
// Set MIME-type explicit
|
||||
SetAttribute("BEOS:TYPE", "application/pdf");
|
||||
|
||||
// pdflib scope: object
|
||||
/*
|
||||
const char* license_key;
|
||||
@@ -303,7 +310,7 @@ PDFWriter::InitWriter()
|
||||
|
||||
REPORT(kDebug, 0, ">>>> PDF_open_mem");
|
||||
PDF_open_mem(fPdf, _WriteData); // use callback to stream PDF document data to printer transport
|
||||
|
||||
|
||||
// pdflib scope:
|
||||
|
||||
PDF_set_parameter(fPdf, "flush", "content");
|
||||
|
||||
Reference in New Issue
Block a user