Merging PDF / Page Numbers / Acrobat SDK V9 & LiveCycle

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default Merging PDF / Page Numbers / Acrobat SDK V9 & LiveCycle

    Hello everyone,

    I use Adobe LiveCycle to create forms, Visual Studio 2005 and the Acrobat SDK for the application I'm programming to fill in these forms. The application fills in the forms and merges them with no issues.

    The problem I have is that these pages have page numbers in the upper right. I use the Page N of M object on these forms in LiveCycle. PDF page numbers are filled in correctly when filling in the forms, but when I merge PDFs, the pages keep their original page numbers. I've looked at the Windows - Interapplication Communications even using templates to no avail.

    How can I merge these pdf's and have my program renumber these pages correctly and how can insert pages anywhere I want in the merge document?

    Below is the code I use to merge the PDF's. It was posted in a forum.

    Sub MergePDF(ByVal ThePath As String, ByVal outFileName As String)
    On Error GoTo serror

    Dim dPDDocMerge As New Acrobat.AcroPDDoc
    Dim dPDDoc As New Acrobat.AcroPDDoc
    Dim strFiles() As String
    Dim numPage As Integer
    Dim TotalPage As Integer
    Dim objThisFile As IO.FileInfo 'get FileInfo object for file string

    strFiles = System.IO.Directory.GetFiles(ThePath) ' Read in the file names

    Dim b As Boolean ' mostly for testing purposes... could use it for error 'checking to make sure that a file is really added before deleleting it...

    For i As Integer = 0 To strFiles.Length - 1 ' run through all the files in 'the directory
    objThisFile = New IO.FileInfo(strFiles(i)) ' Get the extension

    If objThisFile.Extension = ".pdf" Then ' Only add in PDFs

    If dPDDocMerge.GetFileName = "" Then ' check if it's the first file
    dPDDocMerge = New Acrobat.AcroPDDoc = dPDDocMerge.Open(strFiles(i)) ' open first file TotalPage = dPDDocMerge.GetNumPages
    Else
    dPDDoc = New Acrobat.AcroPDDoc = dPDDoc.Open(strFiles(i)) ' open other files numPage = dPDDocMerge.GetNumPages ' get the page count
    TotalPage += numPage = dPDDocMerge.InsertPages(numPage - 1, dPDDoc, 0, dPDDoc.GetNumPages, _ False) ' Insert End If
    End If

    Next
    'b = dPDDocMerge.Save(1, ThePath & "\" & outFileName) ' save file = dPDDocMerge.Save(1, ThePath & "\" & "\MyTest.PDF") ' save file = dPDDocMerge.Close() Exit Sub
    serror:
    MsgBox(ErrorToString)
    End Sub

    Thanks for any code or advice.
    Brent.Jones@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Merging more than one PDF page into a singe page.
      Hi All, Here is my new requirement. I need to merge two PDF page contents into a single PDF page. Is there any way to active this using api's. ...
    2. Merging PDF with Acrobat SDK
      Is it possible to merge PDFs with this SDK without opening up Adobe Acrobat?
    3. Merging two PDF files (even/odd pages) in Acrobat 4.0
      Hello, We have Adobe Acrobat 4.05 and are trying to merge two PDF files that were scanned with a non-duplex network scanner. I have two TIFF...
    4. Add Page Numbers within Adobe Acrobat 5.0 or 6.0
      Can I add page numbers within Adobe Acrobat 5.0 or 6.0? I put together pages from various documents in Adobe Acrobat and can not add the pages...
  3. #2

    Default Re: Merging PDF / Page Numbers / Acrobat SDK V9 & LiveCycle

    You can't merge LiveCycle forms this way :(. LC forms are NOT standard PDF files and can't be processed in the same way.
    Leonard_Rosenthol@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139