Hi All,
I'm trying to create PDF document using AEM guides. i have frontcover, some topics and backcover in PDF. I need to add one blank page at the end of the pdf document using javascript. Is anyone having idea, how to achieve this?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Kiruthika_r ,
You can insert an empty div element at the end of the document and set the style property to page-break-before: always; See example below
var newPage = document.createElement("div");
newPage.setAttribute("style", "page-break-before: always;")
document.body.append(newPage);
You can add your custom logic around this code to achieve the desired result.
You can achieve this without JavaScript. What is the AEM version you are on?
Views
Replies
Total Likes
I'm using AEM version 6.5.18.
Do you have any idea how to implement the blank page creation in PDF using javascript in AEM Guides?
Views
Replies
Total Likes
I meant to ask AEM Guides version, my bad. Can you please quickly share that?
Views
Replies
Total Likes
UUID AEM 6.5
AEM Guides version - 4.3.0
Views
Replies
Total Likes
Thanks, @Kiruthika_r . Do the following in the Native PDF template editor.
You will find more details about page order here
Do let us know if you face any issues.
Thanks,
Vivek
Thanks, @VivekKumar. This solution is working fine for static logic. but I need to get the overall count pages in PDF. Based on the pdf page count, need to add blank pages dynamically using javascript in AEM Guides.
Views
Replies
Total Likes
Hi @Kiruthika_r ,
You can insert an empty div element at the end of the document and set the style property to page-break-before: always; See example below
var newPage = document.createElement("div");
newPage.setAttribute("style", "page-break-before: always;")
document.body.append(newPage);
You can add your custom logic around this code to achieve the desired result.
Thanks @vikchand,
sorry for the delay in response. This code is working fine.
Views
Replies
Total Likes