|
|
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);
}
}
|
|
|
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.
|
|
|
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);
}
|
|
|
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!
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close