Posted: 17 Feb 2017 11:05 EST Last activity: 28 Feb 2017 14:49 EST
Concatenate two Paragraphs or two PDFs into one PDF File.
I have two paragraphs that I need to concatenate into a single PDF file, preserving the line numbering in each document. I am able to append the two paragraphs into a single one and use HTMLToPDF to merge them into one PDF file, but the total line number includes the second file, and I need the total page number to stop at the total number of pages of the first file. Any ideas how to achieve this using Pega activities or pd4ml?
***Updated by moderator: Lochan to update Categories***
I'm not sure I understand the question. You have a 2 page document that you are merging with another 2 page document and then converting them to PDF and are trying to get the final PDF file to be 4 pages long, but report that it only has 2? And similarly with the line numbers, you want to what? To start the counting over again, when the second document starts?
I suspect if you want custom page numbering and custom line numbering, then you'll have to do the numbering outside of the tools within the PDF. The good news is that HTMLtoPDF converts an HTML stream, so if you can figure out how to format the stream to include your line and page numbers, it should convert them to PDF for you. The bad news (assuming I understood you correctly) is that I don't believe there is an out of the box facility to give you what you want.
I have two documents Each document is being held in a Pega Paragraph property. One document will be generated dynamically, and it could have from 3+pages. (3 pages minimum).
The second document will always be two pages. The users want the page numbers in the format Page 1 of 3 on the header (let's say this doc has 3 pages now), and the other document two pages. Pages 4 and 5 will be numbered as 1 and 2 (I'm harcoding this for pages 4 and 5 now). And the first three pages will be numbered Page 1 of 3, and not Page 1 of 5. My current PDF output, I used call HTMLToPDF to merge the two Pega Paragraphs (documents) into one. But the header is showing as Page 1 of 5, instead of Page 1 of 3. I do eliminate the heading "Page $[page] of $[total] for pages 4 and 5. Let me know if I can help you with more info...
Unfortunately, you're problem is a bit outside of my area of expertise. My guess is, if you can get the page count of the first document, you could "hard code" the page numbers, by doing something like page n = n+1, so that if someone were to print out the pages, the numbers would be correct, but I expect the pdf reader software would still say Page n of (grand total number of pages of the two merged documents). If you're using the PDF reader to generate the page count of the first document, things get a lot more complex. You'll probably need to research how to do that directly in PDFs and then figure out how to apply it to the HTML stream that gets converted.