Forum

Jennifer Häfner
Moderator
    Has successfully completed the online course Intermediate (200)
    Has successfully completed the online course Advanced (300)
    Has successfully completed the online course Basics (100)
    Has successfully completed the online course Advanced (310)
    Has successfully completed the online course Advanced (320)
    Has successfully completed the Intermediate Certification
    Has successfully completed the Advanced Certification
2 years, 9 months ago #35820
Up
0
Down
::

Hi Satish,

I figured out a way to display elements in the header dynamically, depending on the current page. You can find the HTML file in the attachments. The elements in the HTML have different classes. In the script that is executed after loading the code, we check on which page we are currently at, and depending on the page number, set the element visible or not.

To use this file, you need to follow the instructions that I gave in this other thread: https://community.simplifier.io/forums/topic/pdf-set-page-number-dynamically-using-footer-section/

Which means that you have to:

  • Upload the HTML file to the assets section of your app
  • Use the CSBO ‘SF_PDF’ – ‘generateWithConfig’ to generate the PDF
  • In the input parameter ‘configJSON’, add the path to the header HTML file:
    {
    "header-spacing": 5,
    "header-html": "/opt/simplifier/data/storage/appDirect/test_JH/data/dynamic_header.html"
    }

    (the path might be different for your Simplifier setup, you need the internal path to the file on the Simplifier system)

  • Deploy your app

Now, the element with the class ‘first’ is only visible on the first PDF page.

Attachments:
You must be logged in to view attached files.