logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Sunday, July 10, 2016 9:00:17 PM(UTC)
 
Well... it is possible.

I have checked the following code. It's works fine.
Code:

PdfCommon.Initialize();

//Create a new document
using (var newDoc = PdfDocument.CreateNew())
{
	//Open PDF document with forms
	using (var doc1 = PdfDocument.Load(@"d:\00\otpt4.pdf"))
	{
		//Open another PDF document.
		using (var doc2 = PdfDocument.Load(@"d:\00\facture.pdf"))
		{
			//Import all pages from first document into newly created document
			newDoc.Pages.ImportPages(
				doc1,
				string.Format("1-{0}", doc1.Pages.Count),
				newDoc.Pages.Count
				);

			//Import all pages from second document into newly created document
			newDoc.Pages.ImportPages(
				doc2,
				string.Format("1-{0}", doc2.Pages.Count),
				newDoc.Pages.Count
				);
		}

		//Save a copy of a document
		newDoc.Save(@"d:\00\result.pdf", SaveFlags.NoIncremental);
	}
}
MischaS Posted: Monday, July 4, 2016 11:55:37 PM(UTC)
 
Hi,

thanks. The code works.

However, why isn't it possible to create a new document and import another one containing a form?


Thank you.
Paul Rayman Posted: Wednesday, June 29, 2016 7:07:43 PM(UTC)
 
Hi,

Could you please show your code?

the code below works fine.

Maybe you are calling FlattenPage somewhere?

Code:

//Initialize the SDK library
//You have to call this function before you can call any PDF processing functions.
PdfCommon.Initialize();

//Open and load a PDF document with forms
using (var mainDoc = PdfDocument.Load(@"d:\00\otpt4.pdf"))
{
	//Open another PDF document.
	using (var doc = PdfDocument.Load(@"d:\00\facture.pdf"))
	{
		//Import all pages from second document into first one
		mainDoc.Pages.ImportPages(
			doc,
			string.Format("1-{0}", doc.Pages.Count),
			mainDoc.Pages.Count
			);
	}

	//Save a copy of a merged document
	mainDoc.Save(@"d:\00\result.pdf", SaveFlags.NoIncremental);

}
MischaS Posted: Wednesday, June 29, 2016 1:44:02 AM(UTC)
 
Hi there,

I am currently merging two files using the ImportPages() method. The first file contains an interactive form, the second doesn't.
After applying ImportPages() the resulting file doesn't contain a form any more. The files get merged but the interactive form is not useable in the merged file.
Why does the form get lost when merging the files?

Thanks!