Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
Brent.Jones@adobeforums.com #1
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
-
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. ... -
Merging PDF with Acrobat SDK
Is it possible to merge PDFs with this SDK without opening up Adobe Acrobat? -
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... -
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... -
Leonard_Rosenthol@adobeforums.com #2
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



Reply With Quote

