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

Gianluigi gradobag at gradobag.it
Sat Feb 24 14:06:23 CET 2024


Il 24/02/24 13:26, Benoît Minisini ha scritto:
> Le 24/02/2024 à 13:03, Benoît Minisini a écrit :
>>
>> It's because you don't use the same resolution in both projects.
>>
>> With gb.poppler, the resolution is explicit.
>>
>> With gb.pdf, the resolution is 72 * the value of the Zoom property.
>>
>> I will try to add a method in gb.poppler that paint a page on the
>> current painter by choosing the good resolution automatically.
>>
>> Regards,
>>
>>
>> Regards,
>>
>
> In the last commit, I modified the Render() method so that if you
> specify the width and height arguments, and not the resolution
> argument, the best drawing resolution will be automatically computed.
>
> That way, no need to tackle the problem of conversion between pixels,
> resolution and absolute size anymore!
>
> Here is the modified code in the DV_PDF_POPPLER project:
>
> Public Sub DocumentView1_Draw(Page As Integer, Width As Integer,
> Height As Integer)
>
>   Dim hImage As Image
>
>   hImage = $PDF_Doc[Page].Render(0, 0, Width, Height)
>   Paint.DrawImage(hImage, 0, 0)
>
> End
>
> Regards,
>
Hi Benoit and Claus,

I would say that now the pdf with gb.poppler is ok.
Attached image

Regards
Gianluigi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdf-poppler.jpg
Type: image/jpeg
Size: 59537 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20240224/bc9ff403/attachment-0001.jpg>


More information about the User mailing list