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
|
#endif
|
||||||
fImageCache.Flush();
|
fImageCache.Flush();
|
||||||
|
|
||||||
PDF_close(fPdf);
|
PDF_close(fPdf);
|
||||||
REPORT(kDebug, 0, ">>>> PDF_close");
|
REPORT(kDebug, 0, ">>>> PDF_close");
|
||||||
|
|
||||||
@@ -247,9 +247,13 @@ PDFWriter::EndJob()
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
void
|
void
|
||||||
PDFWriter::SetAttribute(const char* name, const char* value) {
|
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) {
|
if (file) {
|
||||||
|
file->WriteAttr(name, B_STRING_TYPE, 0, value, strlen(value) + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,6 +268,9 @@ PDFWriter::InitWriter()
|
|||||||
fState = NULL;
|
fState = NULL;
|
||||||
fStateDepth = 0;
|
fStateDepth = 0;
|
||||||
|
|
||||||
|
// Set MIME-type explicit
|
||||||
|
SetAttribute("BEOS:TYPE", "application/pdf");
|
||||||
|
|
||||||
// pdflib scope: object
|
// pdflib scope: object
|
||||||
/*
|
/*
|
||||||
const char* license_key;
|
const char* license_key;
|
||||||
@@ -303,7 +310,7 @@ PDFWriter::InitWriter()
|
|||||||
|
|
||||||
REPORT(kDebug, 0, ">>>> PDF_open_mem");
|
REPORT(kDebug, 0, ">>>> PDF_open_mem");
|
||||||
PDF_open_mem(fPdf, _WriteData); // use callback to stream PDF document data to printer transport
|
PDF_open_mem(fPdf, _WriteData); // use callback to stream PDF document data to printer transport
|
||||||
|
|
||||||
// pdflib scope:
|
// pdflib scope:
|
||||||
|
|
||||||
PDF_set_parameter(fPdf, "flush", "content");
|
PDF_set_parameter(fPdf, "flush", "content");
|
||||||
|
|||||||
Reference in New Issue
Block a user