PDF Utils, TOC and multiple page formats



  • I have an A4 report which uses the TOC concept from your examples. Now I need to append another report in A3 format.
    It's easy to append the A3 report with PDF utils, but some problems remains to solve:

    1. Is it possible to include the A3 pages in the TOC including clickable links?

    2. Sometimes I don't want to append the report. I tried to opt out of rendering with an if statement around the html, but I got an empty page anyway. I suppose I have to completely disable the appended report via PDF Utils. Can I control PDF Utils from beforeRender? Or do I need to configure it completely via the API when I call for the rendering?

    3. I suppose (1) would be easier if all the pages would be rendered from start. But I didn't find a way to switch page format for a specific child report. Is this possible?

    Thanks,
    //Michael



  • Sorry, after some reading I found out that (2) was quite easy. I just did the following in beforeRender:

    req.template.pdfOperations.push({ type: 'append', templateShortid: 'eHnThWPu-F' });
    

    But I'd still like some pointers on how to solve the TOC issue.



  • I have tried to href a hidden toc bookmark in an appended pdf. It doesn't seem to work. I suppose there are some magic happening with these toc hrefs that does not happen in appended pdfs?



  • Is it possible to include the A3 pages in the TOC including clickable links?

    No, this doesn't work. The chrome creates pdf without the necessary objects when you target something not existing.
    I've put a task to the backlog to analyze if there is a potential solution https://github.com/jsreport/jsreport/issues/771

    I suppose (1) would be easier if all the pages would be rendered from start. But I didn't find a way to switch page format for a specific child report. Is this possible?

    I am afraid it isn't possible to switch pages orientation in the middle. Single pdf report with different pages orientation can be produced only with pdf utils and append.



  • Ok, thanks.
    For now I'll just calculate the page positions and add a unclickable rows to the toc. Fortunately, the appended A3 report consists of exactly one page per data item, so I'll know in advance how many pages will be added.



  • Is there any way to create a link to a specified page number in the resulting PDF (including appended reports) instead of linking to an invisible div? I happen to know my page numbers, so this would work.



  • Is there any way to create a link to a specified page number in the resulting PDF

    The pdf source code can cover this I think, but chrome can't and we don't have an extra function or construct.
    So no, I am afraid this can't be done at this moment.

    We will try to solve the cross pdfs clickable links.
    https://github.com/jsreport/jsreport/issues/771



  • Thanks Jan.
    This would be awesome. I'm hoping for a solution.


Log in to reply
 

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