[ 
https://issues.apache.org/jira/browse/PDFBOX-4709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17066912#comment-17066912
 ] 

Tres Finocchiaro commented on PDFBOX-4709:
------------------------------------------

The above issue has an update on this.  I'm quoting it here for those 
interested:
{quote}This issue seems to be caused by precision loss in 
[WPrinterJob.lineTo|https://github.com/AdoptOpenJDK/openjdk-jdk11u/blob/5f01925b80ed851b133ee26fbcb07026ac04149e/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java#L1458]
 which maps to [wingdi.h 
LineTo|https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-lineto].
 In all of the jni functions, floats are passed, but in native, only ints and 
longs are accepted. This causes each node to 'snap to' an integer value, this 
includes bezier curve control points. The \{{drawString }}function utilizes the 
wingdi TextOut function and is unaffected due to the text never being converted 
to curves, It is simply saved as text and the recipient renders it.

Unfortunately this issue seems to be caused by limitations within windgi rather 
than a flaw in its java implementation. I do not know much about the topic, but 
perhaps an alternative could be used.
{quote}
Some ideas proposed are to use GDI+ (which supports the floating point 
precision) or to force the existing GDI implementation to use a more accurate 
[MapMode|https://www-user.tu-chemnitz.de/~heha/petzold/ch05f.htm] both of which 
require changes to the JVM.

In addition to this, I'm in the final phases of a new JDK support contract in 
place so that we can get upstream JDK resources dedicated.

> PDFBox prints text poorly in comparison to Adobe, Chrome, other apps
> --------------------------------------------------------------------
>
>                 Key: PDFBOX-4709
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4709
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.14
>         Environment: Windows 10
> AdoptOpenJDK 11
> PDFBox 2.0.14
>            Reporter: Lite M Finocchiaro
>            Priority: Major
>              Labels: Zebra
>         Attachments: Adoberesult.jpg, Drug-print.pdf, Drug-print.pdf, 
> IMG_20191219_130048_2.jpg, PDFBoxVSgraphicsobj.jpg, PDFBoxresult.jpg, 
> PrintedWithPDFBox.pdf, Screen Shot 2019-12-22 at 2.20.54 PM.png, Screen Shot 
> 2019-12-22 at 2.21.00 PM.png, linux-thermal-test-graphics-frc-4pt.pdf, 
> linux-thermal-test-graphics-frc.pdf, linux-thermal-test-pdfbox-4pt.pdf
>
>
> When printing a PDF from PDFBox to a Zebra GK420d thermal label printer, the 
> text from the PDF is blurry and appears to have the top and bottom cut off 
> compared to printing the same file through Adobe Acrobat.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to