Hello,
After resize a PDF document that has content in fields, the content disappear (I used the latest Adobe Reader to open the PDFs). This is the code I’m using:
string PAGE_RESIZE = "98";
PdfFileEditor fileEditor = new PdfFileEditor();
Document pdfDocument;
using (Stream stream = new MemoryStream(fileContent))
{
//open document
pdfDocument = new Document(stream);
double resize = 100;
if (double.TryParse(PAGE_RESIZE, out resize) && resize < 100)
{
double resizeBottom = 100 - resize;
//Specify Parameter to be used for resizing
PdfFileEditor.ContentsResizeParameters parameters = new PdfFileEditor.ContentsResizeParameters(
null,
PdfFileEditor.ContentsResizeValue.Percents(resize),
null,
PdfFileEditor.ContentsResizeValue.Percents(0),
null,
PdfFileEditor.ContentsResizeValue.Percents(resizeBottom)
);
//Get Pages
var pageArray = Enumerable.Range(1, pdfDocument.Pages.Count).ToArray();
//Resize Pages Contents
fileEditor.ResizeContents(pdfDocument, pageArray, parameters);
}
//save output document
pdfDocument.Save(outputFilePath);
pdfDocument.Dispose();
}
I have attached the original file and the result file.
Can you please help me with this problem?
Thanks