<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PDF with Table of Contents&#x2F;Bookmarks?]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">We're using Qt 5.6.1 (soon to be 5.12.1) for a large C++ Windows/Mac application. In our app, we give users the ability to export their data to a PDF. We're currently using a 3rd party library to achieve this, but we'd like to use native Qt if possible moving forward. However, due to the size of the data we export, navigating around the document is crucial (for a large user file, we're looking at ~14K pages in the export).</p>
<p dir="auto">Is there currently a way to create a table of contents/bookmarks via a generated PDF in Qt 5.6.1/5.12.1? If so, what would be the best way to set this up? If not, are there any plans in the future to add this feature?</p>
<p dir="auto">A few limitations we are under:</p>
<ul>
<li>We can't use Chromium since we support WinXP still (so WebEngine is a problem)</li>
<li>We're only interested in exporting to PDF - reading it isn't a requirement for us</li>
</ul>
<p dir="auto">Thank you in advance!</p>
]]></description><link>https://forum.qt.io/topic/100656/pdf-with-table-of-contents-bookmarks</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 11:16:45 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/100656.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 Mar 2019 22:50:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PDF with Table of Contents&#x2F;Bookmarks? on Thu, 14 Mar 2019 11:25:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> , <a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a><br />
Good one, didn't know about that patch-addition.  It says</p>
<blockquote>
<p dir="auto">Hope to see PDF outlines feature added to official Qt.</p>
</blockquote>
<p dir="auto">because I only know it's not in existing <code>QPdfWriter</code> documentation.</p>
<p dir="auto">Let me get one thing clear: for PDF my code used to use <code>QPrinter</code>, now it uses <code>QWebEnginePage::printToPdf()</code>.  I do not use <code>QPdfWriter</code> (at least not explicitly).  I have asked before what, if any, is the relationship in the PDF generation between these 3 classes?  Does the code/patch for TOC etc. mean that if I wish to avail myself of it I will need to change over to <code>QPdfWriter</code>, it will not be available from the other two classes?  Thanks.</p>
]]></description><link>https://forum.qt.io/post/517448</link><guid isPermaLink="true">https://forum.qt.io/post/517448</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 14 Mar 2019 11:25:00 GMT</pubDate></item><item><title><![CDATA[Reply to PDF with Table of Contents&#x2F;Bookmarks? on Wed, 13 Mar 2019 22:36:17 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
As far as i know, QPdfWriter can't create bookmarks.<br />
however, the Jonas poster there seems to have added it.<br />
<a href="https://bugreports.qt.io/browse/QTBUG-3893" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt.io/browse/QTBUG-3893</a><br />
in<br />
<a href="https://bitbucket.org/jonaslarsson/qextpdfwriter/src" target="_blank" rel="noopener noreferrer nofollow ugc">https://bitbucket.org/jonaslarsson/qextpdfwriter/src</a><br />
However, its somewhat old, so might not be good enough for newest Qt.</p>
]]></description><link>https://forum.qt.io/post/517381</link><guid isPermaLink="true">https://forum.qt.io/post/517381</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Wed, 13 Mar 2019 22:36:17 GMT</pubDate></item><item><title><![CDATA[Reply to PDF with Table of Contents&#x2F;Bookmarks? on Wed, 13 Mar 2019 22:11:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Are you looking for <a href="https://doc.qt.io/qt-5/qpdfwriter.html" target="_blank" rel="noopener noreferrer nofollow ugc">QPdfWriter</a> ?</p>
]]></description><link>https://forum.qt.io/post/517379</link><guid isPermaLink="true">https://forum.qt.io/post/517379</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 13 Mar 2019 22:11:02 GMT</pubDate></item><item><title><![CDATA[Reply to PDF with Table of Contents&#x2F;Bookmarks? on Wed, 13 Mar 2019 09:45:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> , <a class="plugin-mentions-user plugin-mentions-a" href="/user/theredqueen">@<bdi>TheRedQueen</bdi></a><br />
It depends on what you mean by "printer", but since that wiki was written there is now (Qt 5.something, maybe wiki could do with updating) <a href="https://doc.qt.io/qt-5/qpdfwriter.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qpdfwriter.html</a>.  That would be in addition to existing methods (a) via <code>QPrinter.PdfFormat</code> and (b) via <code>QWebEngine</code>, but it's still intended for a "painting device".</p>
<p dir="auto">At any rate, none of these is going to generate anything like an index.  You might intercept the PDF being generated for this, or you might post-process the PDF output file, but you're liable to still want a third-party library....</p>
]]></description><link>https://forum.qt.io/post/517246</link><guid isPermaLink="true">https://forum.qt.io/post/517246</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 13 Mar 2019 09:45:54 GMT</pubDate></item><item><title><![CDATA[Reply to PDF with Table of Contents&#x2F;Bookmarks? on Wed, 13 Mar 2019 05:36:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/theredqueen">@<bdi>TheRedQueen</bdi></a> To my knowledge you can only export to PDF in Qt using QPrinter, see <a href="https://wiki.qt.io/Handling_PDF" target="_blank" rel="noopener noreferrer nofollow ugc">https://wiki.qt.io/Handling_PDF</a></p>
]]></description><link>https://forum.qt.io/post/517190</link><guid isPermaLink="true">https://forum.qt.io/post/517190</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 13 Mar 2019 05:36:15 GMT</pubDate></item></channel></rss>