Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Embedding files to PDF with Qt
I am looking for a preferably cross platform solution to embed an XML file to a PDF file.
If you know a proper Qt solution to it please let me know!
Thank you in advance!
XPlatforms last edited by
Which kind of XML is that?
You would like to add XML to the existing PDF file or just create PDF from XML?
If you want to just create PDF from XML you may open XML with QWebView and print it to PDF. Or open XML with Rich TextEdit and print it to PDF.
PDF has a capability to embed files like attachments.
Qt has a capability to create PDF files with the QPrinter.
I would like to add an invoice in XML format to a PDF invoice.
I know that this is currently not supported by the QPrinter itself, but I could accept a solution which could add attachments to existing PDF files.
can do it.
pdftk html_tidy.pdf attach_files command_ref.html to_page 24 output html_tidy_book.pdf
You can call it with QProcess and it should work nice.
Many thanks for this hint, pdftk seems to be able to deal what I am planning to do!
well i used it to split pdf at random pages, add new pages and other info and then collect it again.
I was very pleased with its stability and performance. (free version)