[Gambas-user] Poppler PDF fitting in DocumentView
Rolf-Werner Eilert
rwe-sse at osnanet.de
Wed Jan 12 11:51:36 CET 2022
Am 12.01.22 um 10:42 schrieb Gianluigi:
>
>
> Il giorno mer 12 gen 2022 alle ore 10:27 Rolf-Werner Eilert
> <rwe-sse at osnanet.de <mailto:rwe-sse at osnanet.de>> ha scritto:
>
>
> 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.
>
> Regards
> Rolf
>
>
> Apologizes, I had the doubt that I didn't understand the question (often
> happens to me).
> View this documentation if you can help you.
> https://www.gambas-it.org/wiki/index.php?title=Codice_essenziale_per_mostrare_un_file_PDF
> <https://www.gambas-it.org/wiki/index.php?title=Codice_essenziale_per_mostrare_un_file_PDF>
>
> https://www.gambas-it.org/wiki/index.php?title=Convertire_una_pagina_di_un_file_PDF_in_una_immagine_con_le_risorse_del_Componente_gb.poppler
> <https://www.gambas-it.org/wiki/index.php?title=Convertire_una_pagina_di_un_file_PDF_in_una_immagine_con_le_risorse_del_Componente_gb.poppler>
> At this moment I have no time to look at your project
>
> Regards
> Gianluigi
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
Yes, this was the source for my trial :)
See this text from the help:
Static Sub Image ( Image As Image, X As Integer, Y As Integer [ , Width
As Integer, Height As Integer, SrcX As Integer, SrcY As Integer,
SrcWidth As Integer, SrcHeight As Integer ] )
Draws an Image, or part of it.
If the Width and Height parameters are specified, then the image is
scaled to fit the specified dimensions.
If SrcX, SrcY, SrcWidth and SrcHeight are specified, the only this part
of the image is drawn.
My impression is that Width and Height react the way SrcWidth and
SrcHeight are supposed to do.
Regards
Rolf
More information about the User
mailing list