<?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[not able to get selection of pdf document]]></title><description><![CDATA[<p dir="auto">When using <code>getAllText</code> I get a  valid <code>QPdfSelection</code>.</p>
<pre><code class="language-python">pdf_view: QPdfView = main_window.ui.pdfView
document: QPdfDocument = pdf_view.document()
current_page: int = pdf_view.pageNavigator().currentPage()

selection: QPdfSelection = document.getAllText(current_page)
print(selection.isValid())
# True
print(selection.boundingRectangle())
# PySide6.QtCore.QRectF(73.000000, 118.000000, 450.000000, 682.000000)
print(selection.text())
# some text ...
</code></pre>
<p dir="auto">But when trying to use <code>getSelection</code> (even with the <code>QPointF</code>s of the boundingRectagle above) I get an invalid selection with a <code>QRectF</code> with all its values set to 0.</p>
<p dir="auto">What do I'm missing?</p>
<pre><code class="language-python">top_left: QPointF = selection.boundingRectangle().topLeft()
bottom_right: QPointF = selection.boundingRectangle().bottomRight()
selection: QPdfSelection = document.getSelection(current_page, top_left, bottom_right)
print(selection.isValid(), selection.boundingRectangle())
print(selection.isValid())
# False
print(selection.boundingRectangle())
# False PySide6.QtCore.QRectF(0.000000, 0.000000, 0.000000, 0.000000)
</code></pre>
]]></description><link>https://forum.qt.io/topic/163082/not-able-to-get-selection-of-pdf-document</link><generator>RSS for Node</generator><lastBuildDate>Mon, 28 Sep 2026 09:02:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163082.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Aug 2025 12:57:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to not able to get selection of pdf document on Tue, 26 Aug 2025 13:04:24 GMT]]></title><description><![CDATA[<p dir="auto">The QPdfView  widget text selection functionality is currently not completely implemented or has bugs, see for example <a href="https://bugreports.qt.io/browse/QTBUG-131443" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt.io/browse/QTBUG-131443</a> .</p>
]]></description><link>https://forum.qt.io/post/830892</link><guid isPermaLink="true">https://forum.qt.io/post/830892</guid><dc:creator><![CDATA[friedemannkleint]]></dc:creator><pubDate>Tue, 26 Aug 2025 13:04:24 GMT</pubDate></item></channel></rss>