2.2.0 Problems PDF Util problems



  • I don't seem to be having much luck with 2.2.0. I've created a report + cover page. The cover page is prepended to the report via pdf utils. When I run the report I get this error.

    Error: Error while executing pdf-utils operations. bad XRef entry
        at module.exports (jsreportRuntime.js:149018:13)
        at Reporter.createError (jsreportRuntime.js:148018:12)
        at AsyncFunction.reporter.afterRenderListeners.insert (jsreportRuntime.js:173521:22)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:188:7)
    caused by: Error
        at UnknownErrorExceptionClosure (jsreportRuntime.js:246893:37)
        at Object.<anonymous> (jsreportRuntime.js:246896:2)
        at __w_pdfjs_require__ (jsreportRuntime.js:246493:30)
        at Object._typeof (jsreportRuntime.js:249450:23)
        at __w_pdfjs_require__ (jsreportRuntime.js:246493:30)
        at Object.defineProperty.value (jsreportRuntime.js:246536:18)
        at jsreportRuntime.js:246539:10
        at webpackUniversalModuleDefinition (jsreportRuntime.js:246466:20)
        at Object.1357../pdf.worker.js (jsreportRuntime.js:246473:3)
        at o (jsreportRuntime.js:1:702)
        at jsreportRuntime.js:1:753
        at Object.1023.pdfjs-dist (jsreportRuntime.js:173768:15)
        at o (jsreportRuntime.js:1:702)
        at jsreportRuntime.js:1:753
        at Object.1024../addPages (jsreportRuntime.js:173824:18)
        at o (jsreportRuntime.js:1:702)
        at jsreportRuntime.js:1:753
        at Object../node_modules/jsreport-pdf-utils/lib/scriptPdfProcessing.js../utils/pdfManipulator (jsreportRuntime.js:971:24)
        at o (jsreportRuntime.js:1:702)
        at jsreportRuntime.js:1:753
        at module.exports.ScriptsManager.execute (jsreportRuntime.js:150205:3)
        at module.exports.tryCatcher (jsreportRuntime.js:46916:23)
        at module.exports.ret [as executeAsync] (eval at makeNodePromisifiedEval (jsreportRuntime.js:45574:12), <anonymous>:13:39)
        at Reporter.executeScript (jsreportRuntime.js:148026:47)
        at AsyncFunction.reporter.afterRenderListeners.insert (jsreportRuntime.js:173503:35)
        at jsreportRuntime.js:186004:33
        at jsreportRuntime.js:185984:16
        at tryCatcher (jsreportRuntime.js:46916:23)
        at Promise._settlePromiseFromHandler (jsreportRuntime.js:44938:31)
        at Promise._settlePromise (jsreportRuntime.js:44995:18)
        at Promise._settlePromiseCtx (jsreportRuntime.js:45032:10)
        at Async._drainQueue (jsreportRuntime.js:41850:12)
        at Async._drainQueues (jsreportRuntime.js:41855:10)
        at Immediate.Async.drainQueues [as _onImmediate] (jsreportRuntime.js:41729:14)
    


  • please share the playground



  • It has something to do with my generic functions there must be a difference between 1.8.2 and 2.2.0

    https://playground.jsreport.net/w/anon/QdNRlBhI

    Run Report to see the error. It's a different error than above I can't replicate above now.



  • The current error comes from your templates. You use some global helpers you didn't correctly attach.
    I fixed it for you
    https://playground.jsreport.net/w/jan_blaha/~jUBl~a7



  • Sorry Jan but what exactly did you do to get it working?



  • ahh was it the tick box on the js file (Shared helpers attached to each template) DOH!!!



  • Jan I still get the bad Xref error when running locally... I think it has something to do with chrome pdf according to google. I can't replicate on your studio.
    Here debug log.

    Error while executing pdf-utils operations. bad XRef entry
    logs:
    +0 Starting rendering request 7 (user: null)
    +2 Rendering template { name: TCLReport, recipe: chrome-pdf, engine: jsrender, preview: true }
    +4 Adding sample data SydCwrY5X
    +103 Resources not defined for this template.
    +154 Base url not specified, skipping its injection.
    +155 Rendering engine jsrender
    +160 Taking compiled template from engine cache
    +162 Executing recipe chrome-pdf
    +753 Running chrome with params {"printBackground":true,"margin":{}}
    +1005 pdf-utils is starting pdf processing
    +1007 Detected 1 pdf operation(s) to process
    Error: Error while executing pdf-utils operations. bad XRef entry
    at module.exports (jsreportRuntime.js:149018:13)
    at Reporter.createError (jsreportRuntime.js:148018:12)
    at AsyncFunction.reporter.afterRenderListeners.insert (jsreportRuntime.js:173521:22)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    caused by: Error
    at UnknownErrorExceptionClosure (jsreportRuntime.js:246893:37)
    at Object.<anonymous> (jsreportRuntime.js:246896:2)
    at w_pdfjs_require (jsreportRuntime.js:246493:30)
    at Object._typeof (jsreportRuntime.js:249450:23)
    at w_pdfjs_require (jsreportRuntime.js:246493:30)
    at Object.defineProperty.value (jsreportRuntime.js:246536:18)
    at jsreportRuntime.js:246539:10
    at webpackUniversalModuleDefinition (jsreportRuntime.js:246466:20)
    at Object.1357../pdf.worker.js (jsreportRuntime.js:246473:3)
    at o (jsreportRuntime.js:1:702)
    at jsreportRuntime.js:1:753
    at Object.1023.pdfjs-dist (jsreportRuntime.js:173768:15)
    at o (jsreportRuntime.js:1:702)
    at jsreportRuntime.js:1:753
    at Object.1024../addPages (jsreportRuntime.js:173824:18)
    at o (jsreportRuntime.js:1:702)
    at jsreportRuntime.js:1:753
    at Object../node_modules/jsreport-pdf-utils/lib/scriptPdfProcessing.js../utils/pdfManipulator (jsreportRuntime.js:971:24)
    at o (jsreportRuntime.js:1:702)
    at jsreportRuntime.js:1:753
    at module.exports.ScriptsManager.execute (jsreportRuntime.js:150205:3)
    at module.exports.tryCatcher (jsreportRuntime.js:46916:23)
    at module.exports.ret [as executeAsync] (eval at makeNodePromisifiedEval (jsreportRuntime.js:45574:12), <anonymous>:13:39)
    at Reporter.executeScript (jsreportRuntime.js:148026:47)
    at AsyncFunction.reporter.afterRenderListeners.insert (jsreportRuntime.js:173503:35)
    at jsreportRuntime.js:186004:33
    at jsreportRuntime.js:185984:16
    at tryCatcher (jsreportRuntime.js:46916:23)
    at Promise._settlePromiseFromHandler (jsreportRuntime.js:44938:31)
    at Promise._settlePromise (jsreportRuntime.js:44995:18)
    at Promise._settlePromiseCtx (jsreportRuntime.js:45032:10)
    at Async._drainQueue (jsreportRuntime.js:41850:12)
    at Async._drainQueues (jsreportRuntime.js:41855:10)
    at Immediate.Async.drainQueues [as _onImmediate] (jsreportRuntime.js:41729:14)



  • Hi @jan_blaha Finally replicated on your playground - https://playground.jsreport.net/w/carl.blanchard/8h8uCA8H



  • Hi, @jan_blaha any news on this problem?



  • It seems to fail because the "TCLReport" is empty.
    Any reason for that?



  • OH how annoying. It was empty just because I was playing/testing 2.2.0... Maybe a bit more defensive development is required in JSReport.


Log in to reply
 

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