-Hi there - I have not received any input on the matter below plz could someone
advise
Kind regards
Geo
Hi there
We currently have a program that merges two sets of pdf using iTextSharp to
display to a user the entire set.
This has been working great for that past few months however the client now in
the one set of pdf's have Adobe LiveCycle type forms, these forms as you may
know are pdf forms where user can fill in / complete fields in the document on
their computers. Like dynamic forms.
The application now gives an error:
"Please wait...
If this message is not eventually replaced by the proper contents of the
document, your PDF
viewer may not be able to display this type of document."
I have search on the net and apparently is a fairly common problem.
I have tried the following code but without much success:
public string MergeDocs(MemoryStream[] files)
{
Document document = new Document();
try
{
PdfWriter writer = PdfWriter.GetInstance(document, new
FileStream(_fileName, FileMode.Create));
document.Open();
PdfContentByte cb = writer.DirectContent;
PdfImportedPage page;
int n = 0;
int rotation = 0;
foreach (MemoryStream filename in files)
{
PdfReader reader = new PdfReader(filename.ToArray());
n = reader.NumberOfPages;
PdfStamper stamper = new PdfStamper(reader, filename) {
FormFlattening = true };
int i = 0;
while (i < n)
{
i++;
document.SetPageSize(reader.GetPageSizeWithRotation(1));
document.NewPage();
page = writer.GetImportedPage(reader, i);
rotation = reader.GetPageRotation(i);
if (rotation == 90 || rotation == 270)
{
cb.AddTemplate(page, 0, -1f, 1f, 0, 0,
reader.GetPageSizeWithRotation(i).Height);
}
else
{
cb.AddTemplate(page, 1f, 0, 0, 1f, 0, 0);
}
}
}
}
catch (Exception e)
{
throw e;
}
finally
{
document.Close();
}
return _fileName;
}
Could anyone plz point me in the right direction?
Kind regards
geo
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php