Product:
PDFNet SDK (AMD64)
Product Version:
10.12.0
Please give a brief summary of your issue:
When trying to flatten a particular pdf it errors out.
Please describe your issue and provide steps to reproduce it:
This might or might not be an application bug but reporting it anyway so you can look into it. The issue is that when trying to flatten a pdf document it errors out. Not sure what is different about this document, but it seems it has some links and other objects. I am not sure how to attach the file here, but I am including the error message below.
Exception: pdftron.Common.PDFNetException: Exception:
Message: Bad String
Conditional expression: false
Version : 10.12.0-2867facaf1
Platform : Windows
Architecture : AMD64
Filename : Parser.cpp
Function : trn::SDF::Parser::LexHexString
Linenumber : 1179
at pdftron.Common.PDFNetException.REX(IntPtr result)
at pdftron.PDF.PDFDoc.FlattenAnnotations(Boolean forms_only)
at pdftron.PDF.PDFDoc.FlattenAnnotations()
Please provide a link to a minimal sample where the issue is reproducible:
public override Stream FlattenPdf(
Stream pdfStream)
{
var outputStream = new MemoryStream();
using var pdfDoc = new PDFDoc(pdfStream);
pdfDoc.FlattenAnnotations();
pdfDoc.Save(outputStream, SDFDoc.SaveOptions.e_compatibility);
pdfDoc.Close();
outputStream.Position = 0;
return outputStream;
}