We’re resizing pdf files to make room for adding a bit of branding at the top and/or bottom of the file. After calling resizeContents() and saving we’re seeing the following error when opening the file in Acrobat Reader.
There was an error processing an annotation or link. There was a problem reading this document (16).
Sample Code:
PdfFileEditor.ContentsResizeParameters parameters = new PdfFileEditor.ContentsResizeParameters(
PdfFileEditor.ContentsResizeValue.units(0),
null,
PdfFileEditor.ContentsResizeValue.units(0),
PdfFileEditor.ContentsResizeValue.units(0),
null,
PdfFileEditor.ContentsResizeValue.units(11)
);
PdfFileEditor editor = new PdfFileEditor();
Document document = new Document(path);
editor.resizeContents(document, parameters);
document.save();
Sample File.zip (201.0 KB)