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?
解決済! 解決策の投稿を見る。
トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。
表示
返信
いいね!の合計
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?
表示
返信
いいね!の合計
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?
表示
返信
いいね!の合計
I meant to ask AEM Guides version, my bad. Can you please quickly share that?
表示
返信
いいね!の合計
UUID AEM 6.5
AEM Guides version - 4.3.0
表示
返信
いいね!の合計
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.
表示
返信
いいね!の合計
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.
表示
返信
いいね!の合計