Error whole generating an PDF using electron-pdf in MVC application



  • Hi,

    I am trying to generate a sample PDF using electron pdf recipe.
    however, i am getting this error.

    Error summary : Recipe 'electron-pdf' not found . I have tried to look a related package in nuget , but i didnt find. could you please help me to find the right way to do this?

    Full Error
    Error rendering report: rendering has finished with errors:Error: An error occurred while trying to execute the command: at onCriticalError ([eval]:29603:25) at tryCatcher ([eval]:36038:23) at Promise._settlePromiseFromHandler ([eval]:34061:31) at Promise._settlePromise ([eval]:34118:18) at Promise._settlePromise0 ([eval]:34163:10) at Promise._settlePromises ([eval]:34238:18) at Async._drainQueue ([eval]:31008:16) at Async._drainQueues ([eval]:31018:10) at Immediate.Async.drainQueues [as _onImmediate] ([eval]:30892:14) at processImmediate [as _immediateCallback] (timers.js:396:17) {"originalError":{"remoteStack":"Error: Recipe 'electron-pdf' not found\n at jsreportRuntime.js:138931:13\n at tryCatcher (jsreportRuntime.js:47291:23)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45313:31)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._resolveCallback (jsreportRuntime.js:45233:57)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45325:17)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at PromiseArray._resolve (jsreportRuntime.js:45704:19)\n at PromiseArray._promiseFulfilled (jsreportRuntime.js:45722:14)\n at Promise._settlePromise (jsreportRuntime.js:45375:26)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._settlePromise (jsreportRuntime.js:45383:21)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._resolveCallback (jsreportRuntime.js:45255:14)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45325:17)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._resolveCallback (jsreportRuntime.js:45233:57)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45325:17)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._resolveCallback (jsreportRuntime.js:45233:57)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45325:17)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at jsreportRuntime.js:44730:21\n at nextTickCallbackWith0Args (node.js:442:9)\n at process._tickCallback (node.js:371:13)"}}(Original) Error: Error during rendering report: Recipe 'electron-pdf' not found at [eval]:36644:23 at ConcatStream.<anonymous> ([eval]:42366:43) at emitNone (events.js:72:20) at ConcatStream.emit (events.js:166:7) at finishMaybe ([eval]:4229:14) at afterWrite ([eval]:4115:3) at nextTickCallbackWithManyArgs (node.js:486:18) at process._tickCallback (node.js:384:17) {"remoteStack":"Error: Recipe 'electron-pdf' not found\n at jsreportRuntime.js:138931:13\n at tryCatcher (jsreportRuntime.js:47291:23)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45313:31)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._resolveCallback (jsreportRuntime.js:45233:57)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45325:17)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at PromiseArray._resolve (jsreportRuntime.js:45704:19)\n at PromiseArray._promiseFulfilled (jsreportRuntime.js:45722:14)\n at Promise._settlePromise (jsreportRuntime.js:45375:26)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._settlePromise (jsreportRuntime.js:45383:21)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._resolveCallback (jsreportRuntime.js:45255:14)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45325:17)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._resolveCallback (jsreportRuntime.js:45233:57)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45325:17)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at Promise._resolveCallback (jsreportRuntime.js:45233:57)\n at Promise._settlePromiseFromHandler (jsreportRuntime.js:45325:17)\n at Promise._settlePromise (jsreportRuntime.js:45370:18)\n at Promise._settlePromise0 (jsreportRuntime.js:45415:10)\n at Promise._settlePromises (jsreportRuntime.js:45494:18)\n at Promise._fulfill (jsreportRuntime.js:45439:18)\n at jsreportRuntime.js:44730:21\n at nextTickCallbackWith0Args (node.js:442:9)\n at process._tickCallback (node.js:371:13)"}

    Using Nuget package manager , i have installed the following packages
    jsreport.Types.1.10.0
    jsreport.Local.1.1.2
    jsreport.Client.2.0.2
    jsreport.Binary.1.10.0
    jsreport.Shared.1.0.1.

    Code Sample

                var rs = new LocalReporting().UseBinary(JsReportBinary.GetBinary()).AsUtility().Create();
                var report = await rs.RenderAsync(new RenderRequest
                {
                    Template = new Template
                    {
                        Recipe = Recipe.ElectronPdf,
                        Engine = Engine.JsRender,
                        Content = "<html>yes</html>",                    
                        // Shortid = "test"
    
                    },
                    //Data = "<html>yes</html>"
    
                }).ConfigureAwait(false);
                var memoryStream = new MemoryStream();
                report.Content.CopyTo(memoryStream);
                byte[] myBynary = memoryStream.ToArray();
    


  • The electron-pdf is a custom recipe and needs to be installed extra.
    See the same answer here in more verbose form.
    https://github.com/jsreport/jsreport-dotnet-example-webapp/issues/3



  • if its not too much. can you please point me to sample implementation?



  • There is link to the docs elaborating how to install it.
    https://jsreport.net/learn/dotnet-local#custom-extensions



  • thanks it helped. but i am seeing an error below. i verifed that jsreport.exe was created in the temp.jsreport\binary-default-1.8.2.0

    Error rendering report: Error: An error occurred while trying to execute the command: at onCriticalError ([eval]:29603:25) at [eval]:29558:13 at tryCatcher ([eval]:36038:23) at Promise._settlePromiseFromHandler ([eval]:34061:31) at Promise._settlePromise ([eval]:34118:18) at Promise._settlePromise0 ([eval]:34163:10) at Promise._settlePromises ([eval]:34238:18) at Async._drainQueue ([eval]:31008:16) at Async._drainQueues ([eval]:31018:10) at Immediate.Async.drainQueues [as _onImmediate] ([eval]:30892:14) at processImmediate [as _immediateCallback] (timers.js:396:17) {"originalError":{}}(Original) Error: An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport.. at null.<anonymous> ([eval]:30773:13) at listener ([eval]:8172:10) at EventEmitter.emit ([eval]:8260:22) at onData ([eval]:85844:8) at Lazy.<anonymous> ([eval]:51354:13) at Lazy.<anonymous> ([eval]:51336:19) at emitTwo (events.js:87:13) at Lazy.emit (events.js:172:7) at Lazy.<anonymous> ([eval]:51337:22) at emitOne (events.js:77:13) at Lazy.emit (events.js:169:7) at yieldTo ([eval]:51444:18) at Function.<anonymous> ([eval]:51482:27) at Lazy.<anonymous> ([eval]:51450:21) at emitOne (events.js:77:13) at Lazy.emit (events.js:169:7) at Socket.<anonymous> ([eval]:51313:22) at emitNone (events.js:67:13) at Socket.emit (events.js:166:7) at emitReadable (_stream_readable.js:419:10) at emitReadable (_stream_readable.js:413:7) at readableAddChunk (_stream_readable.js:164:13) {}



  • Could you please try to update the jsreport.Binary? The latest is 1.10. I think we print better error message there.



  • yes. i think i have latest version jsreport.Binary.1.10.0



  • Sure? You mentioned this path temp.jsreport\binary-default-1.8.2.0 which relates to the 1.8.2 binary.

    Could you copy the jsreport.exe binary to you jsreport folder where you installed the jsreport-electron-pdf and type in cmd jsreport start and paste the output?



  • This post is deleted!


  • please see below. jsreport server was successfully start 10.0 binaries

    but i see this:
    Error rendering report: rendering has finished with errors:Error: An error occurred while trying to execute the command: at onCriticalError ([eval]:29603:25) at tryCatcher ([eval]:36038:23) at Promise._settlePromiseFromHandler ([eval]:34061:31) at Promise._settlePromise ([eval]:34118:18) at Promise._settlePromise0 ([eval]:34163:10) at Promise._settlePromises ([eval]:34238:18) at Async._drainQueue ([eval]:31008:16) at Async._drainQueues ([eval]:31018:10) at Immediate.Async.drainQueues [as _onImmediate] ([eval]:30892:14) at processImmediate [as _immediateCallback] (timers.js:396:17) {"originalError":{"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}}(Original) Error: read ECONNRESET at exports._errnoException (util.js:907:11) at TCP.onread (net.js:558:26) {"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}

    2018-04-06T21:26:35.450Z - info: Initializing jsreport@1.10.0 in development mode using configuration file: jsreport.config.json
    2018-04-06T21:26:35.453Z - info: Searching for available extensions in Projects\ReportsSample\ReportsSample\Jsreport
    2018-04-06T21:26:35.455Z - info: Extensions location cache not found, crawling directories
    2018-04-06T21:26:35.510Z - info: Found 1 extensions
    2018-04-06T21:26:35.514Z - debug: Writing extension locations cache to C:\Users\kamalvi\AppData\Local\Temp\jsreport\core\locations.json
    2018-04-06T21:26:35.519Z - debug: Discovered 1 extensions
    2018-04-06T21:26:35.521Z - info: Using extension cli
    2018-04-06T21:26:35.521Z - info: Using extension import-export
    2018-04-06T21:26:35.522Z - info: Using extension templates
    2018-04-06T21:26:35.523Z - info: Using extension jsrender
    2018-04-06T21:26:35.523Z - info: Using extension authentication
    2018-04-06T21:26:35.524Z - debug: Extension authentication was disabled
    2018-04-06T21:26:35.525Z - info: Using extension tags
    2018-04-06T21:26:35.526Z - info: Using extension handlebars
    2018-04-06T21:26:35.526Z - info: Using extension debug
    2018-04-06T21:26:35.527Z - info: Using extension express
    2018-04-06T21:26:35.539Z - info: Using extension fop-pdf
    2018-04-06T21:26:35.540Z - info: Using extension child-templates
    2018-04-06T21:26:35.541Z - info: Using extension phantom-pdf
    2018-04-06T21:26:35.542Z - info: Using extension fs-store
    2018-04-06T21:26:35.543Z - debug: Extension fs-store was disabled
    2018-04-06T21:26:35.543Z - info: Using extension authorization
    2018-04-06T21:26:35.544Z - debug: Extension authorization was disabled
    2018-04-06T21:26:35.544Z - info: Using extension images
    2018-04-06T21:26:35.546Z - info: Using extension electron-pdf
    2018-04-06T21:26:35.639Z - info: Using extension browser-client
    2018-04-06T21:26:35.640Z - info: Using extension licensing
    2018-04-06T21:26:35.641Z - info: Using extension data
    2018-04-06T21:26:35.641Z - info: Using extension text
    2018-04-06T21:26:35.642Z - info: Using extension reports
    2018-04-06T21:26:35.643Z - info: Using extension resources
    2018-04-06T21:26:35.643Z - info: Using extension base
    2018-04-06T21:26:35.643Z - info: Using extension studio
    2018-04-06T21:26:35.644Z - info: Using extension html-to-xlsx
    2018-04-06T21:26:35.646Z - info: Using extension scripts
    2018-04-06T21:26:35.647Z - info: Using extension assets
    2018-04-06T21:26:35.647Z - info: Using extension scheduling
    2018-04-06T21:26:35.648Z - info: Using extension xlsx
    2018-04-06T21:26:35.651Z - info: Using extension sample-template
    2018-04-06T21:26:35.651Z - debug: Creating samples is disabled
    2018-04-06T21:26:35.653Z - info: Using extension public-templates
    2018-04-06T21:26:35.654Z - debug: Extension public-templates was disabled
    2018-04-06T21:26:35.665Z - info: Creating memory store
    2018-04-06T21:26:35.687Z - info: Creating default express app.
    2018-04-06T21:26:35.772Z - info: jsreport server successfully started on http port: 60826
    2018-04-06T21:26:35.773Z - info: Verifying license key free
    2018-04-06T21:26:35.776Z - info: Using free license
    2018-04-06T21:26:35.778Z - info: reporter initialized



  • Hi, sorry to follow up on this. can you please help me.

    Error rendering report: rendering has finished with errors:Error: An error occurred while trying to execute the command: at onCriticalError ([eval]:29603:25) at tryCatcher ([eval]:36038:23) at Promise._settlePromiseFromHandler ([eval]:34061:31) at Promise._settlePromise ([eval]:34118:18) at Promise._settlePromise0 ([eval]:34163:10) at Promise._settlePromises ([eval]:34238:18) at Async._drainQueue ([eval]:31008:16) at Async._drainQueues ([eval]:31018:10) at Immediate.Async.drainQueues [as _onImmediate] ([eval]:30892:14) at processImmediate [as _immediateCallback] (timers.js:396:17) {"originalError":{"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}}(Original) Error: read ECONNRESET at exports._errnoException (util.js:907:11) at TCP.onread (net.js:558:26) {"code":"ECONNRESET","errno":"ECONNRESET","syscall":"read"}



  • Would you be please able to prepare a minimal repository replicating this failure? I would take a look. Thank you


Log in to reply
 

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