bulia byak wrote:
On 5/26/06, David Christian Berg <david@...407...> wrote:
Cannot open file
The filename "test.pdf" indicates that this file is of type "PDF document". The contents of the file indicate that the file is of type "plain text document". If you open this file, the file might present a security risk to your system.
Apparently your operating system is unaware of the fact that there can be a valid PDF file without compression, i.e. as a plain ASCII text.
With or without compression a PDF file is always a binary file. A common trick to force (mail) systems realize this is to add a few non-ASCII characters in a comment at the beginning of the file. Never heard of viewers needing this.. But if it helps someone and harms no one I guess it is safe to add such a comment
Here's a simple patch (pick your favourite binary characters): ===== PdfObject *PdfFile::begin_document(double version) { Inkscape::SVGOStringStream os; + char bin[5]={'B'+128,'i'+128,'n'+128,'!'+128};
length = 0; pages = new PdfXref();;
os << "%PDF-" << version << "\n"; + os << "%" << bin << "\n";
obj_info = begin_object(); *obj_info << "<<\n";