@jan_blaha : Amazing. It works. I should have posted this query much earlier, spent 2 days in digging out why it's crashing. Thanks again a ton. :)
Posts made by Ritesh Kumar Gupta
-
RE: Merge Error When 2 different pages are prepend before TOC using pdfAddPageItem pageBeforeTOC=true
-
Merge Error When 2 different pages are prepend before TOC using pdfAddPageItem pageBeforeTOC=true
I am trying to add two pages before TOC- say 'title page' and 'disclaimer' page.
The final merged PDF should look like [title, disclaimer, toc, main]
The approach I am taking is:
I am adding{{{pdfAddPageItem pageBeforeTOC=true}}}
on both title and disclaimer template which has to appear before toc.//disclaimer template <p><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></p> {{{pdfAddPageItem pageBeforeTOC=true}}} <p>This is Disclaimer Page</p>
//Title page template <p><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></p> {{{pdfAddPageItem pageBeforeTOC=true}}} <p>This is Title Page</p>
And in toc, I am adding empty pages using helper function:
{{#each (getPagesBeforeTOC @root)}} <!-- in order to produce a new page there must be some element before --> <div style="visibility: hidden;"> </div> <div style="page-break-before: always;"></div> {{/each}}
However, this is crashing:
Error: Error while executing pdf-utils operations. incorrect header check at module.exports (/app/node_modules/jsreport-core/lib/util/createError.js:11:13) at Reporter.createError (/app/node_modules/jsreport-core/lib/reporter.js:332:12) at AsyncFunction.<anonymous> (/app/node_modules/jsreport-pdf-utils/lib/main.js:382:22) caused by: Error: incorrect header check at Zlib.zlibOnError [as onerror] (zlib.js:180:17) at processChunkSync (zlib.js:426:12)
Any help is appreciated.
Here is the narrowest version of the replicator:
https://playground.jsreport.net/w/anon/xSDm7AJxPlease note, If I add only one page before TOC, then it works perfectly without any problem. You can check this by disabling any of the title or disclaimer items in the main pdf-utils merge operation.
In most of the use cases, to create any report "multiple pages with the headers footers+page number" are required to prepend before TOC. Hence, I am looking for a robust solution for this, if my approach above is not the correct one.
Thanks.
-
RE: TOC Links are not clickable when admin example is used as script
Thanks, I got the idea now and was able to implement without need to script here using jsreport.documentStore.collection and pdfutils.
Resolving
-
TOC Links are not clickable when admin example is used as script
Here is the example by admin that creates a clickable TOC in chrome.
https://playground.jsreport.net/w/admin/akYBA4rSI tried replicating the same by using the script instead of pdfutils, however, this does not seem to work.
https://playground.jsreport.net/w/anon/V2YV9L6qCan someone please help me?