Loading...

Merging PDFs

Support for GdPicturePDF Plugin.

Merging PDFs

Postby Loïc » Wed Sep 07, 2011 3:38 pm

Code: Select all
     
      Dim GdPicturePDFSrc As New GdPicture.GdPicturePDF
      Dim GdPicturePDFDst As New GdPicture.GdPicturePDF

      GdPicturePDFDst.NewPDF()

      'Append pages of the first PDF
      If GdPicturePDFSrc.LoadFromFile("c:\pdf1.pdf", False) = GdPictureStatus.OK Then
         For i As Integer = 1 To GdPicturePDFSrc.GetPageCount
            GdPicturePDFDst.ClonePage(GdPicturePDFSrc, i)
         Next
      End If
      GdPicturePDFSrc.CloseDocument()

      'Append pages of the second PDF
      If GdPicturePDFSrc.LoadFromFile("c:\pdf2.pdf", False) = GdPictureStatus.OK Then
         For i As Integer = 1 To GdPicturePDFSrc.GetPageCount
            GdPicturePDFDst.ClonePage(GdPicturePDFSrc, i)
         Next
      End If
      GdPicturePDFSrc.CloseDocument()

      'Write the generated PDF
      GdPicturePDFDst.SaveToFile("c:\mypdf.pdf")
      GdPicturePDFDst.CloseDocument()
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Merging PDFs

Postby Loïc » Mon Oct 17, 2011 7:47 pm

The same approach to merge PDF/A into PDF/A


Code: Select all
          Dim GdPicturePDFSrc As New GdPicture.GdPicturePDF
          Dim GdPicturePDFDst As New GdPicture.GdPicturePDF

          GdPicturePDFDst.NewPDF(True)

          'Append pages of the first PDF
          If GdPicturePDFSrc.LoadFromFile("c:\pdf1.pdf", False) = GdPictureStatus.OK Then
             For i As Integer = 1 To GdPicturePDFSrc.GetPageCount
                GdPicturePDFDst.ClonePage(GdPicturePDFSrc, i)
             Next
          End If
          GdPicturePDFSrc.CloseDocument()

          'Append pages of the second PDF
          If GdPicturePDFSrc.LoadFromFile("c:\pdf2.pdf", False) = GdPictureStatus.OK Then
             For i As Integer = 1 To GdPicturePDFSrc.GetPageCount
                GdPicturePDFDst.ClonePage(GdPicturePDFSrc, i)
             Next
          End If
          GdPicturePDFSrc.CloseDocument()

          'Write the generated PDF
          GdPicturePDFDst.SaveToFile("c:\mypdf.pdf")
          GdPicturePDFDst.CloseDocument()
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture PDF Plugin

Who is online

Users browsing this forum: No registered users and 0 guests