Generate PDF For Children Pages

Last modified by Manuel Leduc on 2023/10/10 16:54

cogExports a page as PDF and get all children pages in the PDF
TypeSnippet
Category
Developed by

Vincent Massol

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents

Description

This will not put a page break between pages. This is a rudimentary way of printing several XWiki pages.

Since XWiki 1.2 it's possible to export several pages as PDF or RTF, using the includechilds=1, includelinks=1 and pagebreaks=1 request parameters. See XWIKI-1289 to follow the status on this.

Code

#if($context.action=="pdf")
  #set($sql = "where doc.parent='$doc.fullName'")
  #foreach($item in $xwiki.searchDocuments($sql))
    #includeTopic($item)
  #end
#end

Get Connected