PDA

View Full Version : QT3.3.8 setOutputFileName



dstevenson
30th August 2011, 13:57
Hi All,

I am new to QT and have a Client who wanted to capture their print output to a printer and save it to PDF. Currently using QT3.3.8 and Visual Studio 2005 on a Windows Platform.

I have used QPrinter::setOutputFileName(pdfFileName.c_str()); to create the PDF. The filename has got a ".pdf" extension and from Documentation I have read should produce a PDF. I have also tried a ".ps" which should give me a Postscript File, but again I get something similar to what I have shown below.

A File gets created but does not look like a PDF. When investigating the file it looks like a ZIP Archive. I copied it to a MAC and investigated the file there.

See below:

mac:test2 $ file *
test.pdf: Zip archive data, at least v2.0 to extract
mac:test2 $
mac:test2 $ unzip test.pdf
Archive: test.pdf
inflating: Metadata/Job_PT.xml
inflating: Metadata/MXDC_Empty_PT.xml
extracting: Documents/1/Metadata/Page1_Thumbnail.JPG
inflating: Documents/1/Pages/_rels/1.fpage.rels
inflating: Documents/1/Pages/1.fpage
inflating: Documents/1/Resources/Fonts/8D7A9FD8-12FC-43B7-A717-5A04442C2A33.odttf
inflating: Documents/1/Resources/Fonts/037CA718-DE6A-4195-825B-FDF980D25DB9.odttf
inflating: Documents/1/Resources/Fonts/74C9641C-5694-46AD-BE0A-E33EFB322F5C.odttf
inflating: Documents/1/_rels/FixedDocument.fdoc.rels
inflating: Documents/1/FixedDocument.fdoc
inflating: _rels/FixedDocumentSequence.fdseq.rels
inflating: FixedDocumentSequence.fdseq
inflating: _rels/.rels
inflating: [Content_Types].xml
mac:test2 $

Any ideas on this, it has me stumped. Looks nothing like a PDF File ????

Would be much appreciated.

wysota
30th August 2011, 19:51
Qt3 doesn't print to pdf by itself. What you got is probably a regular printer job file.

dstevenson
30th August 2011, 23:02
That makes sense, It obviously does not output Postscript either as that is what I tried first...

wysota
30th August 2011, 23:47
If you install a postscript printer driver then it's likely you'll be able to generate postscript output.