Error while executing pdf-utils operations (because) invalid PDF: startxref not found Error: Invalid PDF: startxref not found



  • Error while executing pdf-utils operations
    (because) invalid PDF: startxref not found
    Error: Invalid PDF: startxref not found

    I am getting this error when I change the pdfutils: header. I am using chromepdf. I could not replicate this in playground. I am using 4.2 version of jsreport. Have you come across this error before? What might cause this error?



  • I'd like to note that this issue arises whenever modifications are made to the header or footer. It seems that adding a completely new header or footer is accepted, but I’m not convinced that's the appropriate solution. Could you provide some insight into the circumstances under which this error typically occurs in JsReport?



  • If it adds any meaning: Report "index.pdf" render failed.

    Error while executing pdf-utils operations
    (because) invalid PDF: startxref not found
    Error: Invalid PDF: startxref not found
    at Parser.parse (/var/jsreport/node_modules/@jsreport/pdfjs/lib/parser/parser.js:16:13)
    at module.exports.parseBuffer (/var/jsreport/node_modules/@jsreport/pdfjs/lib/parser/parser.js:99:10)
    at new ExternalDocument (/var/jsreport/node_modules/@jsreport/pdfjs/lib/external.js:7:20)
    at Object.merge (/var/jsreport/node_modules/@jsreport/jsreport-pdf-utils/lib/pdfManipulator.js:50:26)
    at module.exports (/var/jsreport/node_modules/@jsreport/jsreport-pdf-utils/lib/pdfProcessing.js:121:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AsyncFunction.<anonymous> (/var/jsreport/node_modules/@jsreport/jsreport-pdf-utils/lib/worker.js:203:21)
    at async ListenerCollection.fire (/var/jsreport/node_modules/@jsreport/jsreport-core/lib/shared/listenerCollection.js:157:21)
    at async afterRender (/var/jsreport/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:102:5)
    at async WorkerReporter._render (/var/jsreport/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:143:7)
    wrapped by:
    Error: Error while executing pdf-utils operations
    (because) invalid PDF: startxref not found
    at module.exports (/var/jsreport/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)
    at WorkerReporter.createError (/var/jsreport/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:49:12)
    at AsyncFunction.<anonymous> (/var/jsreport/node_modules/@jsreport/jsreport-pdf-utils/lib/worker.js:220:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ListenerCollection.fire (/var/jsreport/node_modules/@jsreport/jsreport-core/lib/shared/listenerCollection.js:157:21)
    at async afterRender (/var/jsreport/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:102:5)
    at async WorkerReporter._render (/var/jsreport/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:143:7)
    at async /var/jsreport/node_modules/@jsreport/jsreport-core/lib/worker/reporter.js:224:19
    at async processAndResponse (/var/jsreport/node_modules/@jsreport/advanced-workers/lib/workerHandler.js:41:17)



  • I found the issue. The footer was in html recipe and the index file was in chrome-pdf recipe. Changing the footer to chrome-pdf solved it.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.