We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Appending another PdfLoadedDocument to a PdfDocument causes header/footer stretching

Thread ID:





120986 Oct 31,2015 09:37 AM UTC Nov 2,2015 07:09 AM UTC ASP.NET MVC 2
Tags: PDF
Bardia Navvabian
Asked On October 31, 2015 09:37 AM UTC

I have this issue and already have searched all over the net, but nothing yet.
I have a PdfDocument that upon circumstances it has some pages and after adding the first page I've set the Header/Footer all upon the existing documents on the website.
but when I append a PDFLoadedDocument to it, from the first page to the end of PDFDocument header and footer will be stretched.
I even tried to add header and footer after appending the other document or even setting page size for PdfDocument or even using ImportPageRange instead of append method, but it has not changed at all.
I'd appreciate your help.
P.S: I've added an exported sample for you to see how it is.

Attachment: Test_Plan_49da1002.rar

Bardia Navvabian
Replied On November 2, 2015 04:52 AM UTC

After a lot of headache and trouble, one of my friend help me solve this weird problem.
Instead of appending second document ( that was a PDFLoadedDocument ) he used graphics to draw every page in the first doc ( that was a PDFDocument ).

for (int i = 0, count = anotherDoc.Pages.Count; i < count; ++i)
     PdfPage page = doc.Pages.Add();
     PdfGraphics g = page.Graphics;

     PdfPageBase lpage = anotherDoc.Pages[i];
     PdfTemplate template = lpage.CreateTemplate();

     g.DrawPdfTemplate(template, PointF.Empty, page.GetClientSize());
I hope it could help somebody too.

Abirami Selvan [Syncfusion]
Replied On November 2, 2015 07:09 AM UTC

Hi Bardia,

We are happy to know that your issue has been resolved . Please let us know if you need any further assistance.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon