add page as templated and continue pdf

Hello

I could not overcome of the following. Suppose you assemble your PDF by adding text, tables  etc and tracking coordinate with Pdflayoutresult. Then I have to insert an existing PDF (as templated doc) with whatever content as per current coord on current page, (and then continue assembling pdf) however the content of existing pdf gets chopped out and doesn't continue on forthcoming page. How to overcome this?


Attached result with discrepancies on page 4-5, and sample pdf (to be inserted) to be inserted


Thanks, G



Attachment: discrepancy_on_page_4_ec3f1db1.zip

1 Reply 1 reply marked as answer

GE Gergo May 26, 2022 11:07 AM UTC

solved by directly drawing out the template

like so:


Snippet
MemoryStream croppedStream = CropPDF(@"g:\\sample.pdf");
                    PdfLoadedDocument loadedDocument = new PdfLoadedDocument(croppedStream);
 
                    //Load the page
                    PdfLoadedPage loadedPage = loadedDocument.Pages[0as PdfLoadedPage;
 
                    //Create the template from the page
                    PdfTemplate template = loadedPage.CreateTemplate();
                    layoutResult = template.Draw(doc.Pages[doc.Pages.Count - 1], new PointF(0, layoutResult.Bounds.Bottom + 5));

Marked as answer
Loader.
Up arrow icon