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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Insert page from another PDF document

Thread ID:

Created:

Updated:

Platform:

Replies:

99577 May 30,2011 07:00 AM UTC Jun 1,2011 06:15 AM UTC WinForms 3
loading
Tags: PDF
Guido Schrage
Asked On May 30, 2011 07:00 AM UTC

Hi,

I'm importing pages to a PdfDocument from a template PDF file located in the filesystem with the PdfDocument.ImportPage(...) method.

How can I insert such a loaded page at a specific position? The ImportPage(...) method just appends it.

The PdfDocument.Pages.Insert(...) method crashes, stating that the page already exists in another section.

Hope you can help me out, Regards


Geetha M [Syncfusion]
Replied On May 31, 2011 06:03 AM UTC

Hi Guido,

Thank you for your interest in Syncfusion products.

You may create a PdfTemplate of the loaded page and draw at a new position in a new PdfDocument. Please refer to the code snippet given below:

PdfPage page = doc1.Pages.Add();
PdfGraphics g = page.Graphics;

PdfPageBase lpage = doc2.Pages[0];
PdfTemplate template = lpage.CreateTemplate();

g.DrawPdfTemplate(template, new PointF(100,100), page.GetClientSize());

Also, following is the link to our documentation which explains the same:
Import Pages As Templates
Please try this and let us know if you have any questions.

Regards,
Geetha


Guido Schrage
Replied On May 31, 2011 08:42 AM UTC

Hi Geetha,

thanks for your response. I already read this solution, but what I don't mentioned in my first post (sorry) is that my PDF file template contains form fields and those get lost when just drawing an PdfTemplate on a new page.

I also don't know how to get the form fields of a specific page.

Any suggestions :) ?

Regards


Geetha M [Syncfusion]
Replied On June 1, 2011 06:15 AM UTC

Hi Guido,

Thank you for the details.

Currently it is not possible to import an existing page with formfields based on position.

Please let us know if you have any questions.

Regards,
Geetha


CONFIRMATION

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.

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

;