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.
Unfortunately, activation email could not send to your email. Please try again.

Appending another PdfLoadedDocument to a PdfDocument causes header/footer stretching

Thread ID:





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

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 1, 2015 11:52 PM

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 02:09 AM

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.

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.