[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


Il 28/02/24 17:10, Claus Dietrich ha scritto:
Am 24.02.24 um 13:26 schrieb Benoît Minisini:
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

Am 24.02.24 um 14:06 schrieb Gianluigi:
Hi Benoit and Claus,

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

Benoit: Thank you for your efforts and

Gianluigi: thanks for your test

but a test with the up to date master and the newly proposed draw
event handling routine (without setting the document resolution) still
shows that gb.pdf provides a better result. The difference is not
overwhelmingly but it is clearly visible.

Here the 1:1 comparison as screenshot:
https://magentacloud.de/s/aKDS2d2ySgKRn4K

Upper: gb.pdf

Lower; gb.poppler

The rendering result of gb.pdf is also competitive with a document
viewer like xreader and hence my reference.

Text rendering is a very complex subject which I do not fully
understand but I believe that a "suitable" resolution cannot be the
only key for a good result. I am wondering what gb.pdf is doing
differently.

Best regards

Claus

Hi Claus,

here with my hardware, gb.poppler looks slightly sharper overall.
This probably depends on the hardware and perhaps, indeed certainly, I
no longer see as well as before but to my eyes and on my screen the
image you posted is equivalent.
That is to say, I don't notice any differences between the two windows.

I greet you and wish you a good evening
Gianluigi


----[ http://gambaswiki.org/wiki/doc/netiquette ]----