[poppler] Scaling factor and placement accuracy

William Bader williambader at hotmail.com
Sun Mar 26 20:11:13 UTC 2017


When I open the test PDF in atril (the Mate desktop version of evince) and change the window size (with 'fit page width'), once I get below about 80%, small changes make the bars of the staff go up and down, and not all of the bars of the staff shift equally, so the space between the bars is not equal, and that might contribute to the effect that the notes are misplaced. I am not sure, but it seems as if it is not antialiasing the bars. When you reduce the image to the point where pixels are significant and the total number of pixels is not the exact amount to leave the same number of pixels between each bar, rounding can't create more pixels. You need to simulate fractional pixels through antialiasing. The 'w' command in PDF sets the line width. It looks like it is drawing lines of 0.4, 0.65, 0.8, and 1 point. The tests for thinLineMode are in splash/Splash.cc.


William


________________________________
From: poppler <poppler-bounces at lists.freedesktop.org> on behalf of pqt at LEFerguson.com <pqt at LEFerguson.com>
Sent: Sunday, March 26, 2017 12:34 PM
To: Albert Astals Cid; poppler at lists.freedesktop.org
Subject: Re: [poppler] Scaling factor and placement accuracy

>> ourParent->document->setRenderHint(Poppler::Document::Antialiasing);
>> ourParent->document->setRenderHint(Poppler::Document::TextAntialiasing
>>ourParent->document->setRenderHint(Poppler::Document::ThinLineSolid);

>Tried thin line shape instead of thing line solid?

Thanks, Albert, I just tried it, same result.

I spent a couple hours last night trying to find the area of code that does the actual placement without any real luck, to see if there is any kind of rounding issue.   I saw a lot of other possible areas like anti-aliasing, but basically got lost in the code because I don't know enough to know what is actually inside the PDF (I tried PDFStreamDumper and can see what's inside, and even seeing it I do not understand it).

So far making the x/y scale factor integral appears to avoid the problem; it's hard to prove a negative, but I have not seen it occur in that case. This just very slightly throws off the desired size I want, and I just needed to put a proper color border into the overall page to avoid showing an outline, so it's very workable for what I want, if it keeps working.

Thanks again,

Linwood
_______________________________________________
poppler mailing list
poppler at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler
poppler Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/poppler>
lists.freedesktop.org
Subscribing to poppler: Subscribe to poppler by filling out the following form. You will be sent email requesting confirmation, to prevent others from ...



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler/attachments/20170326/f1e0e44d/attachment.html>


More information about the poppler mailing list