I've written an application to process a big load of PDF's by parsing data from a CSV file. The problem I've got is that I want to save the first page of the PDF and the first page only. When I use PdfReader's reader.SelectPages("1")
it causes the form fields to be flattened. If I comment it out, everything works fine.
Any ideas why this method would cause all form fields to be flattened? It exports the one page correctly however.
Here's a small extract:
PdfReader reader = new PdfReader(formFile);
reader.SelectPages("1");
string newFile = Environment.CurrentDirectory + @"\Out" + documentCount + ".pdf";
PdfStamper stamper = new PdfStamper(reader, new FileStream(newFile, FileMode.Create), '\0', true);
AcroFields fields = stamper.AcroFields;
If I comment out the second line, there's no problems at all. I guess this is for people whom know how to use iTextSharp.
Cheers