[Gambas-user] Poppler PDF fitting in DocumentView

Rolf-Werner Eilert rwe-sse at osnanet.de
Wed Jan 12 10:26:05 CET 2022

Am 12.01.22 um 09:46 schrieb Gianluigi:
> Il giorno mer 12 gen 2022 alle ore 08:56 Rolf-Werner Eilert 
> <rwe-sse at osnanet.de <mailto:rwe-sse at osnanet.de>> ha scritto:
>     I have questions about the poppler library way of doing things.
>     Some time ago I got some code examples from Gianluigi, and now I tried
>     one of them which seemed to be practical for me.
>     In a DocumentView a PDF shall be shown.
>     ...
> Hi Rolf,
> I didn't try your project but I think you should look carefully about 
> the properties of objects in FMain.form of my example.
> You must learn how to use the property Arrangement, Expand etc.
> You must learn to use the containers...
> Regards
> Gianluigi
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

This is not the point here, Gianluigi.

I tried the example with the ImageView as well. Same thing here.

Of course it is possible to adapt the view to the image, but trying to 
show the image in a smaller scale will just cut it.

I need this function to show a PDF in a collection of files, i. e. you 
have a dialog with a list of items you click on, and a preview will show 
its contents. So the preview area is of a fixed size, and the PDFs shown 
have to be scaled so they fit into it completely. In my case, the 
preview area even is square so it can show landscape PDFs as well.

The old version of this is with gb.PDF, just four lines do it:

   PDF.Open(druck.TempVerz() &/ CStr(VorschauName) & ".pdf")
   PDF.Zoom = 0.5
   Abbild = PDF[VorschauSeite].Image.Picture
   Vorschau.Picture = Abbild

I thought I could work with .Zoom in Poppler too, but it doesn't run 
like expected.


More information about the User mailing list