Append first doc in loop

Append first doc in loop

Forum member · Nov 23, 2005
In a loop I create and merge PDFs. My problem is that I don't know if one loop will create a pdf or not. The code gets complicated if I in each loop have to test how many PDFs I have created. Something like case 0 files created - do nothing case 1 file created - remember the filename case 2 files created - merge the remembered file plus the new one case >2 files created - append the new file It would be much easier if I in each loop could use some kind of append independent of how many files (incl. none) are merged earlier. MergeDocument.Merge and MergeDocument.Append doesn't function. Do you have a solution? Eje

Re: Append first doc in loop

Support · Nov 23, 2005
Hello Eje, There is no limitation to the number of times you can use the Append method. Appending all the files at once and then outputing the resultant PDF document will be more efficient than creating individual PDF documents and then appending them again to another PDF document. Thanks, ceTe Software Support Team

Re: Append first doc in loop

Forum member · Nov 23, 2005
Thanks for your quick reply! I understand what you say about appending all files at the same time. I didn't explain my problem clear enough. Is it possible to start building my final MergeDocument by adding just one pdf-file? I got an error message when I tried to use Append and Merge requires two files. Eje

Re: Append first doc in loop

Support · Nov 23, 2005
Hello Eje, Yes, you can start building your final MergeDocument with one PDF file. There is a MergeDocument constructor that accepts the file path. Following is the link to the Help Documentation on our web site that shows use of MergeDocument constructor that accepts a single PDF file to begin with: Merging Documents Thnaks, ceTe Software Support Team

Re: Append first doc in loop

Forum member · Nov 23, 2005
Thanks again for your very quick reply. This was my first try since I bought the program and everything functions well. Eje