[Gambas-user] How to know how many pages a pdf file has.

Ru Vuott vuott at ...325...
Thu Apr 24 19:16:04 CEST 2014


Hello Tobias,

If I try with  " PdfDocument.Count "
I obtain this error:

" PdfDocument.Count is not static "

bye



--------------------------------------------
Gio 24/4/14, Tobias Boege <taboege at ...626...> ha scritto:

 Oggetto: Re: [Gambas-user] How to know how many pages a pdf file has.
 A: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
 Data: Giovedì 24 Aprile 2014, 17:11
 
 On Thu, 24 Apr 2014, Ru
 Vuott wrote:
 > Hello,
 > 
 > I
 "suppose", to know how many pages a pdf file has,
 I should use this line:
 > 
 >       pdf.Index.Count
 > 
 > Where pdf is a
 "PdfDocument".
 > 
 > I do not know if I'm wrong, but I can
 not run that line.
 > 
 > *************************************
 > 
 > Public Sub
 Form_Open()
 > 
 >  Dim
 index As Short = 1
 >  Dim pdf As New
 PdfDocument
 >  Dim pc As Picture
 >   
 >   
 >   With pdf
 >   
    .Open("/path/of/my/file.pdf")
 >       If .Ready = True
 Then
 > ' It loads first page:
 >      pc = pdf[1].Image.Picture
 > 
 >     
 PictureBox1.Picture = pc
 >     
 PictureBox1.Resize(pdf[1].Width, pdf[1].Height)
 > 
 >   Else
 >      Message.Error("<FONT
 color=darkred><B>Unable loading file pdf
 !")
 >     Quit
 >   Endif
 > 
 
 >   End With
 >   
 >   Print pdf.Index.Count 
 '  <=======
 >   
 > End
 > 
 >
 ****************************************************
 > 
 > I obtain at that
 line this error notice:
 > " Null
 object "
 > 
 > I
 do not understand....
 > 
 
 Have you tried
 PdfDocument.Count? :-)
 
 --
 
 "There's an old saying: Don't
 change anything... ever!" -- Mr. Monk
 
 ------------------------------------------------------------------------------
 Start Your Social Network Today - Download eXo
 Platform
 Build your Enterprise Intranet with
 eXo Platform Software
 Java Based Open Source
 Intranet - Social, Extensible, Cloud Ready
 Get Started Now And Turn Your Intranet Into A
 Collaboration Platform
 http://p.sf.net/sfu/ExoPlatform
 _______________________________________________
 Gambas-user mailing list
 Gambas-user at lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list