Product: PDFTron
Product Version:“@pdftron/pdfnet-node”: “^10.9.0-1”,
Please give a brief summary of your issue:
Error creating new PDF from pages 84 to 405:
Exception:
Message: Obj can’t be NULL (0)
Conditional expression: obj
Version : 10.9.0-274970b356
Platform : Windows
Architecture : AMD64
Filename : Array.cpp
Function : trn::SDF::Array::Insert
Linenumber : 97
Please describe your issue and provide steps to reproduce it:
I can’t able to split particular pages from the below attached PDF. PDF looks fine and I can able to do with some other packages and adobe. I done with Node
try {
console.log(Processing page range: ${start} to ${end}
);
const newPDF = await PDFNet.PDFDoc.create();
await newPDF.insertPages(0, pdfDoc, start, end, PDFNet.PDFDoc.InsertFlag.e_none);
const suffix = `${count.toString().padStart(2, '0')}`;
const newPDFName = `${outputPrefix}_${suffix}.pdf`;
await newPDF.save(newPDFName, PDFNet.SDFDoc.SaveOptions.e_linearized);
await newPDF.destroy();
count++;
} catch (error) {
console.error(`Error creating new PDF from pages ${start} to ${end}: ${error.message}`);
}
Please provide a link to a minimal sample where the issue is reproducible: