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

Re: DocumentView confusion


The Page parameter in _Layout and _Draw... is the real page number.

Maybe I need to correct the Other properties to use only real page numbers
and not indexing... But I'm afraid about back compatibility

Le dim. 16 nov. 2025 à 22:01, Fabien Bodard <gambas.fr@xxxxxxxxx> a écrit :

> '' Return the index of the first visible page.
> Property Read FirstVisiblePage, FirstVisibleDocument As Integer
>
> '' Return the index of the last visible page.
> Property Read LastVisiblePage, LastVisibleDocument As Integer
>
> FirstVisibleDocument and LastVisibleDocument are aliases
> for FirstVisiblePage and  LastVisiblePage
>
> These parameters are just the value of the partially drawn pages. They are
> in fact used by the event manager to call pictures that need to be drawn.
>
> The component remembers the content unless the zoom is used. in this case
> the drawing need to be refreshed.
>
>
> Private $hPdf As PdfDocument
>
> Public Sub Button1_Click()
>
>   If Not Dialog.OpenFile() Then
>
>     $hPdf = New PdfDocument(Dialog.Path)
>     DocumentView1.Count = $hPdf.Count
>   Endif
>
> End
>
> Public Sub DocumentView1_Layout(Page As Integer)
>
>   Last.Layout.Width = $hPdf[Page].W
>   Last.Layout.Height = $hPdf[Page].H
>
> End
>
> Public Sub DocumentView1_Draw(Page As Integer, Width As Integer, Height As
> Integer)
>
>   Paint.DrawImage($hPdf[Page].Render(0, 0, Width, Height), 0, 0)
>
> End
>
>
>

-- 
Fabien Bodard

Follow-Ups:
Re: DocumentView confusionLee <t.lee.davidson@xxxxxxxxx>
Re: DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>
References:
DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: DocumentView confusionLee <t.lee.davidson@xxxxxxxxx>
Re: DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: DocumentView confusionLee <t.lee.davidson@xxxxxxxxx>
Re: DocumentView confusionFabien Bodard <gambas.fr@xxxxxxxxx>
Re: DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: DocumentView confusionGianluigi <gradobag@xxxxxxxxxxx>
Re: DocumentView confusionGianluigi <gradobag@xxxxxxxxxxx>
Re: DocumentView confusionLee <t.lee.davidson@xxxxxxxxx>
Re: DocumentView confusionGianluigi <gradobag@xxxxxxxxxxx>
Re: DocumentView confusionFabien Bodard <gambas.fr@xxxxxxxxx>