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:
Philippe Houdoin
2005-10-25 09:30:52 +00:00
parent 888248d42e
commit 1ae9567747
@@ -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 (file) {
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; 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;