Unsolved Embedding files to PDF with Qt
-
Hello all,
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!
-
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. -
@XPlatforms
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. -
@martonmiklos
Hi
pdftk
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
can do it.pdftk html_tidy.pdf attach_files command_ref.html to_page 24 output html_tidy_book.pdf
https://www.linux.com/learn/manipulating-pdfs-pdf-toolkitYou can call it with QProcess and it should work nice.
-
@mrjj
Many thanks for this hint, pdftk seems to be able to deal what I am planning to do! -
@martonmiklos
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)