How to exclude some content from PDF export?

Last modified by Vincent Massol on 2022/10/13

It's possible to selectively exclude some content from a PDF export (or any other export) by modifying the content using the Velocity macro.

For example imagine that you have a page with a TOC macro and you'd like that the PDF export doesn't export the TOC since the PDF export already have the option to include a special page for the TOC.

Here's how you could modify your content.



= Heading1 =

Hello world

After change:

#if ($xcontext.action != 'export' && $request.format != 'pdf')

= Heading1 =

Hello world

Note: Something similar can be achieved with the LaTeX Export.


Get Connected