Multipage PDF create with one image per page

Discussions about PDF management.
Post Reply
johnslevin
Posts: 4
Joined: Tue Mar 02, 2010 2:14 pm

Multipage PDF create with one image per page

Post by johnslevin » Tue Mar 09, 2010 7:01 pm

Hi
Is it possible to create a PDF file, which will have one image on each of its pages, without the need to set the list of image resources before creating the first page. (this would make code conversion a lot easier for me)
i.e. I would like to do this

Code: Select all

  If Imaging1.PdfNewPdf(App.Path & "\demo.pdf", "Title", "Creator", "Author", "Producer") Then
      Imaging1.PdfSetMeasurementUnits (2) 'measure unit is centimeters

      'Page 1
      Call Imaging1.PdfSetPageDimensions(20, 15) 'Pages dimensions will be 20 x 15 cm
      Imaging1.PdfNewPage
      'ADD THE RESOURCE AFTER NEW PAGE
      nImageID = Imaging1.PdfAddImageFromFile(App.Path & "\Nénuphars.jpg")
      If nImageID <> 0 Then
         Call Imaging1.PdfDrawImage(nImageID, 10, 10, 3, 2.5)
      End If

      'Page 2
      Call Imaging1.PdfSetPageDimensions(20, 15) 'Pages dimensions will be 20 x 15 cm
      Imaging1.PdfNewPage
      'ADD THE RESOURCE AFTER NEW PAGE
      nImageID2 = Imaging1.PdfAddImageFromFile(App.Path & "\XYZ.jpg")
      If nImageID2 <> 0 Then
         Call Imaging1.PdfDrawImage(nImageID2, 10, 10, 3, 2.5)
      End If
cheers
john

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Multipage PDF create with one image per page

Post by Loïc » Wed Mar 10, 2010 10:06 am

Hi John,

Yes it is possible with latest version ;)

Please update your GdPicture component and run your code. it should work !


Kind regards,

Loïc

johnslevin
Posts: 4
Joined: Tue Mar 02, 2010 2:14 pm

Re: Multipage PDF create with one image per page

Post by johnslevin » Mon Mar 15, 2010 12:54 pm

Thanks
I'll do that
(sorry for late reply... been working on another project)
cheers
john

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests