Hi,
We are using version 20.3.0 of the Aspose.PDF for .NET component and we are experiencing the following with resizing a PDF that has highlighted text in it.
Resizing the input file lorem-input.zip (86.6 KB) to 5% less using the following code:
var fileEditor = new PdfFileEditor();
var parameters = new PdfFileEditor.ContentsResizeParameters(
PdfFileEditor.ContentsResizeValue.Percents(5),
null,
PdfFileEditor.ContentsResizeValue.Percents(5),
PdfFileEditor.ContentsResizeValue.Percents(5),
null,
PdfFileEditor.ContentsResizeValue.Percents(5));
fileEditor.ResizeContents(document, parameters);
will result in the output lorem-ouput.zip (85.5 KB) that Acrobat Reader (version 20 on a Win 10 machine) will throw the error:
There was an error processing an annotation or link. There was a problem reading this document (16).
Since this looks like problem with annotation not being properly resized, we tried to shake this off by adding the following code post-resizing:
foreach (var page in document.Pages)
{
foreach (var annotation in page.Annotations)
{
annotation.Contents = annotation.Contents;
}
}
The output document is not longer corrupted in the eyes of Acrobat Reader but the highlighted text is off.
We are looking for both a definitive fix for this but in the mean time we are up for any kind of workaround/suggestion on how to mitigate this.
Best regards,
Alin