<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[QElectroTech — Functional Cross-Reference in PDF]]></title>
		<link>https://qelectrotech.org/forum/viewtopic.php?id=2915</link>
		<atom:link href="https://qelectrotech.org/forum/extern.php?action=feed&amp;tid=2915&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Functional Cross-Reference in PDF.]]></description>
		<lastBuildDate>Sat, 30 May 2026 11:57:38 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22954#p22954</link>
			<description><![CDATA[<p> I&#039;ve made a bit of progress; try this fix based on master branch:<br />Needs:<br /></p><div class="codebox"><pre><code>sudo apt install qtbase5-private-dev</code></pre></div><p> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sat, 30 May 2026 11:57:38 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22954#p22954</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22949#p22949</link>
			<description><![CDATA[<p> The new feature is available as a pull request on GitHub.</p><p>Once it&#039;s merged, I&#039;ll quickly add the German translation so that everything can be rolled out at once, including my previous pull request. </p>]]></description>
			<author><![CDATA[null@example.com (Kellermorph)]]></author>
			<pubDate>Fri, 29 May 2026 17:17:07 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22949#p22949</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22948#p22948</link>
			<description><![CDATA[<p> Thank you very much. My father-in-law gave me the same advice, and I try to spend as much time with them as possible. </p>]]></description>
			<author><![CDATA[null@example.com (Kellermorph)]]></author>
			<pubDate>Fri, 29 May 2026 17:07:00 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22948#p22948</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22946#p22946</link>
			<description><![CDATA[<p> Have a lovely vacation, Thomas, and make the most of your time with the family, wife, and childrens. I didn’t get to see my sons grow up – time flies so quickly, and they’ve already overtaken me – but today, I’m amazed to see just how much my two adorable grandsons have grown – wow, they’re bursting with energy and are so clever and absolutely adorable. &lt;3 </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Fri, 29 May 2026 15:15:53 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22946#p22946</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22942#p22942</link>
			<description><![CDATA[<p> Hi Laurent,<br />I&#039;m currently working on another feature, and after that I&#039;ll be going on vacation with my wife and kids. So unfortunately, I won&#039;t be able to get to it anytime soon.<br />Other than that, I only use AI (Gemini) for all my editing. </p>]]></description>
			<author><![CDATA[null@example.com (Kellermorph)]]></author>
			<pubDate>Fri, 29 May 2026 10:54:27 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22942#p22942</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22941#p22941</link>
			<description><![CDATA[<p> Hallo Thomas wip, could you have a look at this patch based on the master branch (Qt5)? The links work, but it’s very difficult to find the good X and Y coordinates even with AI.... </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Fri, 29 May 2026 10:13:12 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22941#p22941</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22940#p22940</link>
			<description><![CDATA[<p> @plc-user</p><p>Excellent work on the position list — this is exactly the right foundation. I can bring two missing pieces.</p><p>**1. The Qt API you were looking for: `QPdfEngine::drawHyperlink`**</p><p>The Qt PDF engine already supports link annotations internally via a private method:</p><p>```cpp<br />void QPdfEngine::drawHyperlink(const QRectF &amp;r, const QUrl &amp;url)<br />```</p><p>It is accessible (unofficially) by casting the paint engine after `diagram-&gt;render()`:</p><p>```cpp<br />#include &lt;private/qpdf_p.h&gt;</p><p>// After diagram-&gt;render(painter, ...) on each page:<br />if (printer-&gt;outputFormat() == QPrinter::PdfFormat) {<br />&nbsp; &nbsp; auto *pdfEngine = dynamic_cast&lt;QPdfEngine*&gt;(painter-&gt;paintEngine());<br />&nbsp; &nbsp; if (pdfEngine) {<br />&nbsp; &nbsp; &nbsp; &nbsp; // painter-&gt;worldTransform() captures the scale applied by render()<br />&nbsp; &nbsp; &nbsp; &nbsp; // Use it to map scene coordinates -&gt; printer coordinates<br />&nbsp; &nbsp; &nbsp; &nbsp; QTransform t = painter-&gt;worldTransform();<br />&nbsp; &nbsp; &nbsp; &nbsp; for (auto &amp;link : xrefLinksForThisPage) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QRectF printerRect = t.mapRect(link.sourceRect);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QUrl&nbsp; &nbsp;target(QString(&quot;page=%1&amp;x=%2&amp;y=%3&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .arg(link.targetPage)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .arg(link.targetX)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .arg(link.targetY));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pdfEngine-&gt;drawHyperlink(printerRect, target);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}<br />```</p><p>This is private API (requires Qt private headers: `QT += gui-private` in .pro or `find_package(Qt6 ... PRIVATE)` in CMake), so it could theoretically change between Qt versions — but it has been present and stable since Qt 4 and is still there in Qt 6.11. QTBUG-44563 (open since 2015) tracks the request for a public API.</p><p>The `painter-&gt;worldTransform()` is the key to solving your zoom/fit_page problem: after each `diagram-&gt;render(painter, targetRect, sourceRect, Qt::KeepAspectRatio)`, the painter&#039;s world transform already encodes the exact scale and offset applied. Mapping the scene-space link rectangles through this transform gives the correct printer-space coordinates automatically.</p><p>**2. An important correctness issue: page number vs. folio label**</p><p>Using `page=N` as the link target works if folio order never changes. But QET supports two different ways to identify folios:</p><p>- `%f` — position in the tree (physical page number in the PDF). If the user reorders folios, all links break.<br />- `%F` — the folio label, stable regardless of position in the tree.</p><p>If users configure their XRef formulas with `%F` instead of `%f`, they expect links to follow the folio wherever it moves. A link based on `page=N` does not honour this.</p><p>The robust solution is to build a **named destination dictionary** before the print pass:<br />```<br />folio_label -&gt; (physical_page_number, y_position)<br />```<br />Then use the label as the link target instead of the page number. Unfortunately `drawHyperlink` only accepts a `QUrl`, so named internal destinations would require writing raw PDF annotations — which means either a post-processing step (as Alfonso&#039;s Python script does) or a third-party library (libmupdf, QPDF).</p><p>For a pragmatic first implementation, `page=N` with `drawHyperlink` is a good start — it works correctly as long as the folio order at export time matches the XRef labels. Just worth documenting the limitation.</p><p>**Summary**</p><p>- `QPdfEngine::drawHyperlink` + `painter-&gt;worldTransform()` solves the injection and the coordinate scaling in one step<br />- Named destinations (for `%F` stability) require a post-processing pass or lib — this is a known limitation of what Qt exposes today<br />- Your position list code is the right foundation; the missing piece was just how to inject it</p><p>Happy to help test or integrate this if you share the patch. </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Fri, 29 May 2026 08:24:58 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22940#p22940</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22213#p22213</link>
			<description><![CDATA[<p> Ich komme momentan mit Chatgpt echt nicht weiter.<br />Es hängt noch daran, dass der Querverweis vom Bauteil angehangen wird.</p><p>Momentan wird in der projectprintwindow.cpp noch verschiedene Sachen erkannt. Ich habe euch meinen aktuellen Stand mal angehangen.<br />Die blauen Rechtecke sind die, die schon passend auf den Slave-Querverweisen positioniert werden. </p><p>Möglicherweise hat noch jemand von euch eine Idee.<br />Damit ihr euch ein Bild machen könnt, habe ich auch ein kleines Projekt angehangen, womit ich das teste.</p><p>Translate:<br />I&#039;m really stuck at the moment.<br />It still depends on the cross-reference being attached to the component.</p><p>At the moment, various things are still being recognized in projectprintwindow.cpp. I&#039;ve attached my current status for you.<br />The blue rectangles are the ones that are already positioned correctly on the slave cross-references. </p><p>Maybe one of you has an idea.<br />To give you an idea, I&#039;ve also attached a small project that I&#039;m using to test this.</p><p>Translated with DeepL.com (free version) </p>]]></description>
			<author><![CDATA[null@example.com (Kellermorph)]]></author>
			<pubDate>Mon, 20 Oct 2025 18:05:00 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22213#p22213</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=22196#p22196</link>
			<description><![CDATA[<p> Ich bin seit langem mit ChatGPT dran, und versuche die Verlinkung hinzubekommen.</p><p>Wir arbeiten auf dem Skript von PLC-User weiter.</p><p>Wir haben bereits den Erfolg, dass Rote Rechtecke reingezeichnet werden.</p><p>Hierbei fällt auf, dass diese nicht richtig positioniert werden. Die landen auf dem Bauteil und nicht auf dem Verweis.</p><p>Weiß jemand, wo die Koordinaten vom den Querverweis gespeichert ist, damit man diese übernehmen kann? </p><p>Translate:<br />I&#039;ve been working with ChatGPT for a long time and am trying to get the link to work.</p><p>We are continuing to work on the PLC-User script.</p><p>We have already succeeded in drawing red rectangles.</p><p>However, it is noticeable that these are not positioned correctly. They end up on the component and not on the reference.</p><p>Does anyone know where the coordinates of the cross-reference are stored so that they can be transferred?&nbsp; </p><p>Translated with DeepL.com (free version) </p>]]></description>
			<author><![CDATA[null@example.com (Kellermorph)]]></author>
			<pubDate>Thu, 16 Oct 2025 17:23:28 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=22196#p22196</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=21732#p21732</link>
			<description><![CDATA[<p> Hello!</p><p>Are there any further developments on this?</p><p>I would like to leave a link to the post where I share a tool that generates the links in a .pdf automatically.<br /><a href="https://qelectrotech.org/forum/viewtopic.php?id=2982">https://qelectrotech.org/forum/viewtopic.php?id=2982</a><br />We have built on what has been published in this post so far, and with the help of AI we have generated the tool.</p><p>I preferred to separate the posts so as not to mix up the tools.</p><p>Hopefully this can help in the development to integrate the function into QET! </p>]]></description>
			<author><![CDATA[null@example.com (Alfonso)]]></author>
			<pubDate>Mon, 16 Jun 2025 11:06:10 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=21732#p21732</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=21418#p21418</link>
			<description><![CDATA[<p> Based on the qt6-make branch with some more cleanup regarding Qt version checks.</p><p>By the way: I have to take a closer look at git-branches. How to use them and so ...&nbsp; <img src="https://qelectrotech.org/forum/img/smilies/nomicons/wink.png" width="20" alt="nomicons/wink" /> </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Sun, 23 Mar 2025 15:22:45 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=21418#p21418</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=21412#p21412</link>
			<description><![CDATA[<p> Hallo plc-user!</p><p>You could share a patch? </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 23 Mar 2025 13:10:05 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=21412#p21412</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=21405#p21405</link>
			<description><![CDATA[<p> </p><div class="quotebox"><cite>plc-user wrote:</cite><blockquote><p>Auch, wenn Du den Text als Link markierst und den Text als Ziel-Adresse definieren kannst: <br />Das Ziel muss auch wissen, daß es Ziel ist, (...)</p></blockquote></div><p>In the meantime, I have written a code that creates a position list with links and targets in the print module that can be used to insert PDF links. <br />I just haven&#039;t found anything in the Qt docs that explains what a link or a corresponding target should look like so that it works in the PDF file!</p><div class="codebox"><pre><code>***** find positions for PDF-internal links...
XRef from page 3 QPoint(1380,620) to page 4 QPoint(120,440)
XRef from page 3 QPoint(1380,770) to page 4 QPoint(120,90)
XRef from page 3 QPoint(1380,640) to page 4 QPoint(120,420)
XRef from page 3 QPoint(1380,600) to page 4 QPoint(120,400)
XRef from page 3 QPoint(1380,790) to page 4 QPoint(120,110)
XRef from page 4 QPoint(120,90) to page 3 QPoint(1380,770)
XRef from page 4 QPoint(1320,90) to page 5 QPoint(120,90)
XRef from page 4 QPoint(120,110) to page 3 QPoint(1380,790)
XRef from page 4 QPoint(120,440) to page 3 QPoint(1380,620)
XRef from page 4 QPoint(1320,110) to page 5 QPoint(120,110)
XRef from page 4 QPoint(120,400) to page 3 QPoint(1380,600)
XRef from page 4 QPoint(120,420) to page 3 QPoint(1380,640)
XRef from page 5 QPoint(1380,90) to page 6 QPoint(120,90)
XRef from page 5 QPoint(120,90) to page 4 QPoint(1320,90)
XRef from page 5 QPoint(1380,110) to page 6 QPoint(120,110)
XRef from page 5 QPoint(120,110) to page 4 QPoint(1320,110)
XRef from page 6 QPoint(120,110) to page 5 QPoint(1380,110)
XRef from page 6 QPoint(1380,270) to page 8 QPoint(110,180)
XRef from page 6 QPoint(1380,440) to page 8 QPoint(110,440)
XRef from page 6 QPoint(1380,410) to page 8 QPoint(110,410)
XRef from page 6 QPoint(1380,240) to page 8 QPoint(110,210)
XRef from page 6 QPoint(120,90) to page 5 QPoint(1380,90)
XRef from page 8 QPoint(110,440) to page 6 QPoint(1380,440)
XRef from page 8 QPoint(110,180) to page 6 QPoint(1380,270)
XRef from page 8 QPoint(110,410) to page 6 QPoint(1380,410)
XRef from page 8 QPoint(110,210) to page 6 QPoint(1380,240)</code></pre></div><p>There are also additional constraints such as fitting on the page or the print area. &quot;Automagic&quot; zoom factors are used here, which also have to be applied to the positions of the links and targets. </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Sat, 22 Mar 2025 22:04:50 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=21405#p21405</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=21347#p21347</link>
			<description><![CDATA[<p> @scorpio810:<br />It&#039;s not just about the Registry-script:<br />It seems that <strong>many</strong> attachments are lost somehow!</p><p>If you look at this post from 20. February: <br /><a href="https://qelectrotech.org/forum/viewtopic.php?pid=21099#p21099">https://qelectrotech.org/forum/viewtopi … 099#p21099</a></p><p>There should be a png as attachment, but there is only a link!<br />When I follow the link, it says:<br /></p><div class="codebox"><pre><code>Bad request. The link you followed is incorrect or outdated.</code></pre></div><p>Same here with post from 10. March<br /><a href="https://qelectrotech.org/forum/viewtopic.php?pid=21220#p21220">https://qelectrotech.org/forum/viewtopi … 220#p21220</a><br /></p><div class="codebox"><pre><code>Bad request. The link you followed is incorrect or outdated.</code></pre></div><p> </p>]]></description>
			<author><![CDATA[null@example.com (plc-user)]]></author>
			<pubDate>Sun, 16 Mar 2025 00:40:13 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=21347#p21347</guid>
		</item>
		<item>
			<title><![CDATA[Re: Functional Cross-Reference in PDF]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=21345#p21345</link>
			<description><![CDATA[<p> @plc-user,<br />I was able to fix my error...I re-imported the attached files from the rsnapthot backup and on the server for SQL database with phpMyAdmin I re imported the old ‘punbb_attach_files’ table for recreate these ‘indexes!</p><p>But the last backup was made yesterday at 15h00, so please put again your script, many sorry. </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sat, 15 Mar 2025 21:30:39 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=21345#p21345</guid>
		</item>
	</channel>
</rss>
