Merging PDF / Page Numbers / Acrobat SDK V9 & LiveCycle


hello everyone,

i use adobe livecycle create forms, visual studio 2005 , acrobat sdk application i'm programming fill in these forms. application fills in forms , merges them no issues.

the problem have these pages have page numbers in upper right. use page n of m object on these forms in livecycle. pdf page numbers filled in correctly when filling in forms, when merge pdfs, pages keep original page numbers. i've looked @ windows - interapplication communications using templates no avail.

how can merge these pdf's , have program renumber these pages correctly , how can insert pages anywhere want in merge document?

below code use merge pdf's. posted in forum.

sub mergepdf(byval thepath string, byval outfilename string)
on error goto serror

dim dpddocmerge new acrobat.acropddoc
dim dpddoc new acrobat.acropddoc
dim strfiles() string
dim numpage integer
dim totalpage integer
dim objthisfile io.fileinfo 'get fileinfo object file string

strfiles = system.io.directory.getfiles(thepath) ' read in file names

dim b boolean ' testing purposes... use error 'checking make sure file added before deleleting it...

for integer = 0 strfiles.length - 1 ' run through files in 'the directory
objthisfile = new io.fileinfo(strfiles(i)) ' extension

if objthisfile.extension = ".pdf" ' add in pdfs

if dpddocmerge.getfilename = "" ' check if it's first file
dpddocmerge = new acrobat.acropddoc
b = dpddocmerge.open(strfiles(i)) ' open first file
totalpage = dpddocmerge.getnumpages
else
dpddoc = new acrobat.acropddoc
b = dpddoc.open(strfiles(i)) ' open other files
numpage = dpddocmerge.getnumpages ' page count
totalpage += numpage
b = dpddocmerge.insertpages(numpage - 1, dpddoc, 0, dpddoc.getnumpages, _ false) ' insert
end if
end if

next
'b = dpddocmerge.save(1, thepath & "\" & outfilename) ' save file
b = dpddocmerge.save(1, thepath & "\" & "\mytest.pdf") ' save file
b = dpddocmerge.close()
exit sub
serror:
msgbox(errortostring)
end sub

thanks code or advice.

you can't merge livecycle forms way :(. lc forms not standard pdf files , can't processed in same way.


More discussions in Acrobat SDK


adobe

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code