Posted by a ceTe Software moderator
Hello Sunny,
Yes, you can add the imported contents at desired positions on the page by specifying X and Y position coordinates. Below is the code sample.
PdfDocument pdf = new PdfDocument(@"Path for input PDF");
PdfPage page = pdf.Pages[0];
float xPosition = 0;
float yPosition = 400;
ImportedPageArea sectionA = new ImportedPageArea(page, xPosition, yPosition);
sectionA.Contents.ClipBottom = 100;
sectionA.Contents.ClipLeft = 200;
sectionA.Contents.ClipRight = 200;
sectionA.Contents.ClipTop = 0;
ImportedPageArea sectionB = new ImportedPageArea(page, 0, 0);
sectionB.Contents.ClipBottom = 0;
sectionB.Contents.ClipLeft = 200;
sectionB.Contents.ClipRight = 200;
sectionB.Contents.ClipTop = 100;
Document document = new Document();
Page newPage = new Page();
document.Pages.Add(newPage);
newPage.Elements.Add(sectionA);
newPage.Elements.Add(sectionB);
document.Draw(@"Path to save output PDF");
DynamicPDF Generator for .NET uses a coordinate system based on points. You can refer to the documentation on coordinate system
here.
Thanks,
ceTe Software Support Team