<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Broken clipping in PDF export"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=130150">130150</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Broken clipping in PDF export
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>5.3.5.2 release
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>graphics stack
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>glogow@fbihome.de
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=157375" name="attach_157375" title="Broken clipping in non-form PDF export shows Markierfeld titles">attachment 157375</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=157375&action=edit" title="Broken clipping in non-form PDF export shows Markierfeld titles">[details]</a></span>
Broken clipping in non-form PDF export shows Markierfeld titles
When converting the attached ODT to PDF, for example via command line like:
soffice --convert-to pdf --outdir . broken_pdf_clipping.odt
or in Writer using PDF export *without* selecting "create PDF form", the
resulting PDF document looses the clipping of the existing checkbox titles.
Reverting the patch from <a class="bz_bug_link
bz_status_VERIFIED bz_closed"
title="VERIFIED FIXED - Missing images and charts when exporting to PDF (print to PDF works)"
href="show_bug.cgi?id=99680">bug 99680</a> fixes this problem.
The history of the problem is something like:
- commit 581806182ac7 ("<a class="bz_bug_link
bz_status_VERIFIED bz_closed"
title="VERIFIED FIXED - Missing images and charts when exporting to PDF (print to PDF works)"
href="show_bug.cgi?id=99680">tdf#99680</a> modified clipping for PDF export")
- commit 86b47f5138c0 ("<a class="bz_bug_link
bz_status_VERIFIED bz_closed"
title="VERIFIED FIXED - Printing/Exporting to PDF adds text to the side of form elements ('checkbox',...)"
href="show_bug.cgi?id=44388">tdf#44388</a>: handle the NULL clip correctly for pdf
output")
- commit a334752d091f ("vcl109: #i65128# avoid breaking polygonal clip regions
into rectangles in PDF export").
The latest patch changed the semantics of the clip region parameters:
- m_bClipRegion = true
- m_aClipRegion.count() == 0
from "// NULL clip, i.e. nothing visible" to "no clipping applied".
This inherently conflicts with the code of PDFWriterImpl::intersectClipRegion,
which "intersects clip regions". When intersecting clip regions / polygons, the
result might be an empty intersection, but that doesn't mean, no clipping, but
nothing visible.
In the attached bug document that's the clip of the check box inside the clip
of the table.
Obviously the revert results in <a class="bz_bug_link
bz_status_VERIFIED bz_closed"
title="VERIFIED FIXED - Missing images and charts when exporting to PDF (print to PDF works)"
href="show_bug.cgi?id=99680">bug 99680</a> again. Inspecting that original bug
shows rounding problems with the simple test document attached to that bug
(<span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=133268" name="attach_133268" title="Simple test case - original odt">attachment 133268</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=133268&action=edit" title="Simple test case - original odt">[details]</a></span>), resulting in an empty clip region for the first stack
object from calling basegfx::utils::solvePolygonOperationAnd in
PDFWriterImpl::intersectClipRegion.
And in the end it's also the origin of <a class="bz_bug_link
bz_status_NEW "
title="NEW - numerical inconsistency in basegfx::utils::isInside() causes wrong clipping in PDF export"
href="show_bug.cgi?id=113449">bug 113449</a>, which is also about rounding
problems in intersectClipRegion, but in an other place in the call stack. Both
bugs AFAIK fail in stripDispensablePolygons. This one in B2DRange::isInside,
the other one in basegfx::utils::isInside, used to detect the case of polygons
inside each other. Since these fail, no intersection is detected and the result
is empty, or - with <a class="bz_bug_link
bz_status_VERIFIED bz_closed"
title="VERIFIED FIXED - Missing images and charts when exporting to PDF (print to PDF works)"
href="show_bug.cgi?id=99680">tdf#99680</a> applied - completely unclipped / visible.
<a class="bz_bug_link
bz_status_NEW "
title="NEW - numerical inconsistency in basegfx::utils::isInside() causes wrong clipping in PDF export"
href="show_bug.cgi?id=113449">Bug 113449</a> claims "there is no problem with the commit [581806182ac7]", but
from my analysis, the patch is wrong, or I misunderstood that analysis.
Still I currently also have no good idea where to fix it and do the rounding to
fix the comparison. This is some subtle rounding problem in the basegfx based
stack. And it's definitely no easy hack from the analysis point of view, even
when a real fix might be as simple as a single round or an adapted comparison.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>