-
AdityaHas successfully completed the online course IntroductionHas successfully completed the online course Basics (100)1 year ago #35406
Hi Team,
We have to set the element fixed at the bottom of page 1, if there is some data which can be adjusted above, that is OK, but if the data exceeds the data, then it should be moved to the next page with that element being fixed at bottom of the first page.
That is the specific element should be fixed at the bottom of the first page irrespective of the data before and after that.
Thanks in advance !!
Jennifer HäfnerHas 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 CertificationHas successfully completed the Advanced Certification1 year ago #35667::Hi Satish,
I see two options here:
1) Add the table header to your header section and remove it from the body (you might have to add an additional margin to the body so that nothing overlaps)
2) Use the HTML tag ‘thead’, which automatically repeats a table header on every page: https://www.w3schools.com/tags/tag_thead.asp
Vitali KurdasovHas successfully completed the online course Intermediate (200)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the Intermediate CertificationAdityaHas successfully completed the online course IntroductionHas successfully completed the online course Basics (100)Vitali KurdasovHas successfully completed the online course Intermediate (200)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the Intermediate Certification1 year ago #35441::Hi Aditya,
i don’t have a good answer for this, the only way i found that works is with css for the specific element that you want to have at the bottom.
My solution is to create a css class that moves that element absolutly:
.myclass{
top: 842px;
transform: translate(50%,-50%);
right:50%;
position: absolute;
}Adjust the top pixels by your favor
Maybe someone else has a better option then me.
Satish1 year ago #35563Satish1 year ago #35748Jennifer HäfnerHas 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 CertificationHas successfully completed the Advanced Certification1 year ago #35820::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.SatishJennifer HäfnerHas 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 CertificationHas successfully completed the Advanced Certification1 year ago #35826::Hi Satish,
I found a way that hopefully meets the requirements of your use case: instead of specifying the HTML files in the PDF config object, you can directly insert them into the header/footer section of the PDF template. Then, you have access to the JSON data that is given as input for the PDF template.
With this approach, you do not use the ‘generateWithConfig’ function to generate a PDF, you can simply use ‘generate’.
For example, you can insert the content of the file ‘dynamic_header.html’ into the header section, and then access the material number etc. from the JSON data.
You must be logged in to reply to this topic.