[Gambas-user] Blurry text when PDF pages are rendered with gb.poppler and displayed with a DocumentView

Claus Dietrich claus.dietrich at freenet.de
Fri Feb 2 20:24:16 CET 2024


Here are two applications which Hans prepared for comparison and 
reference for this subject.

Version with gb.pdf: https://magentacloud.de/s/26WJ7cCX5goezXK

Version with gb.poppler: https://magentacloud.de/s/ZdCmx7RQjiftZPX

Regards

Claus


Am 02.02.24 um 19:36 schrieb Claus Dietrich:
> While exploring gb.poppler classes for a new Gambas Buch chapter and 
> after a comparison with the old gb.pdf component, we noticed that the 
> rendering of pdf documents with the
> PdfDocument class of gb.poppler delivers images with a noticeably 
> blurry text when displayed in a DocumentView. This is what we did:
>
> Rendering with gb.pdf:
>
> Public Sub DocumentView1_Draw(Page As Integer, Width As Integer, 
> Height As Integer)
>     Paint.DrawImage(hPDFDoc[Page + 1].Image, 0, 0, Width, Height)
> End
> For an A4 page this delivers an image with the dimensions w=673 and 
> h=952.
>
> Rendering with gb.poppler:
>
> Public Sub DocumentView1_Draw(Page As Integer, Width As Integer, 
> Height As Integer)
>   Paint.DrawImage(hPDFDoc[Page].Render(), 0, 0, width, height)
> End
> For an A4 page this delivers an image with the dimensionsw=595 and h=842.
>
> The dimensions delivered with gb.poppler seem to be correct because 
> 210/25.4*72 = 595. However, why 72dpi? To get the same dimensions as 
> obtained with gb.pdf I had to change the resolution property of the 
> PDFDocument to 81.4 dpi (gb.pdf doesn't offer this property). But to 
> my surprise even with that higher resolution the displayed result in 
> the DocumentView was blurry. How can this happen?
>
> Rendering with gb.pdf is our benchmark because the sharpness of the 
> displayed pages is comparable with those of the document reader Xreader.
>
> Where is the mistake?
>
> Best regards
> Claus
>
>
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DV_PDF_PDF-2.1.7.tar.gz
Type: application/gzip
Size: 171674 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240202/6599ff2e/attachment-0002.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DV_PDF_POPPLER-2.1.14.tar.gz
Type: application/gzip
Size: 171509 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240202/6599ff2e/attachment-0003.gz>


More information about the User mailing list