Expand my Community achievements bar.

PDF generation in AEM using fragments


Level 2

Hello friends,

I am currently working on a task to create pdf files using content fragment in AEM version 6.2.

I can create a page using fragments and then can use PDF writer bundle to see page as pdf.

But also need to warn the user for the case when content fragments on page results in pdf more than 2 pages.

Could someone please advise how can I achieve this ?



3 Replies


Level 9


Quick follow up questions: 

Do you want each page to be converted in PDF? Or Only fragments added in the page should be generated as PDF?



I would recommend you to please have a look at this article :- How do I Render a Page as PDF? | Adobe CQ (AEM) Blueprints

// How can I configure the PDF rewriter?

     The easiest method is to simply override the .xsl file used by default with CQ.  This is found in the repository at      /libs/wcm/core/content/pdf/page2fo.xsl.  Write the xsl-fo and the xslt the way you would normally.

I hope this would help you.


Kautuk Sahni


Level 2

This is not acceptable advice, even less so coming from Adobe staff! It's explicitly stated time and time again NOT to modify anything under /libs. This file was overwritten during a recent SP2 upgrade. Please beware.