Getting error on PDF split

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:

1 Like

Hi,
I posted the above query regarding an issue I’m experiencing with PDFTron but haven’t received any responses yet.

1 Like

Hello! Thanks for reaching out and thanks for your patience. I am unable to reproduce this on my side, as well, the PDF you sent over is not accessible to me. To be able to investigate further, are you able to share a PDF which reproduces this issue?

If not, I would suggest trying to update to our latest release via NPM, which is version 10.10, and see if the issue still persists.

1 Like

The issue is not yet resolved. Please find the sample pdf Contract_Doctrine.pdf - Google Drive

1 Like

Thank you so much for getting the sample PDF over to us. To be able to investigate this error further could you share a couple more things:

  1. How much memory the system has.
  2. Which version of Node are you using, this can be found by using “npm -v”
  3. The code used to load the initial PDF and code for determining important variables.
  4. An explanation of the full life cycle of the PDF, what is it you are trying to achieve.

Thank you for your patience.

1 Like