Product: WebViewer
Product Version: 8.2.0
Please give a brief summary of your issue:
doc.extractXFDF fails when I call it on a particular pdf document
I have the code below that linearizes a pdf file. When I pass my file to it, it fails with the error:
{
"type": "InvalidPDF",
"message": "Exception: \n\t Message: Exception: \n\t Message: Put() can't be invoked on Obj of this type.\n\t Conditional expression: false\n\t Version : 9.1.1-158c71b047\n\t Platform : Emscripten\n\t Architecture : Emscripten\n\t Filename : \n\t Function : IllegalFunctionException\n\t Linenumber : 821\n\n\t Filename: \n\t Function: \n\t Linenumber: "
}
The code is shown below.
const linearizePdf = async (fullPath) => {
return new Promise(async (resolve, reject) => {
const licenseKey = pdfTronLicenseJs;
const path = fullPath;
const extension = 'pdf';
try {
let doc = await CoreControls.createDocument(path, { l: licenseKey, extension });
let result = await doc.extractXFDF();
const options = {
flags: CoreControls.SaveOptions.LINEARIZED,
xfdfString: result.xfdfString
};
let data = await doc.getFileData(options);
const arr = new Uint8Array(data);
const blob = new Blob([arr], { type: 'application/pdf' });
resolve(blob);
} catch (err) {
reject(err);
}
});
}
Please describe your issue and provide steps to reproduce it:
1.) Run the code above with the file I will provide
2.) It will raise an exception on the doc.extractXFDF line
For internal reasons, I cannot provide a link to the file here. Please reply with your email address so I can send you the file directly along with additional instructions.
Please provide a link to a minimal sample where the issue is reproducible: N/A