PDF Export a Webpage - Documentation topics on: deprecated,macros,pdf export,.

PDF Export a Webpage

Creates an icon that exports the current page as a PDF document

Macro Overview:





Optional Parameters:

  • pdfExportIcon
    Point to an image file to show as the icon. Default: /portal/images/icons/pdf.gif.
  • pdfExportAltText
    Sets the alt text. Default: Export to PDF.
  • pdfUserURL
    If set to true, the macro will pass the URL to servlet, otherwise it will pass the identifier. Passing the URL is useful for wiki pages. Default: false.
  • pdfFileName
    Sets the name of the PDF. If not set it will be set to the page title.



Example 1: A simple example using the required fields

#set($pdfFileName='My PDF Title')
#set($pdfExportAltText='Create PDF document')

Example 2: An example showing how to include one or more of the optional parameters

If you need to exclude some code from your page from getting parsed or displayed by the PDF Macro you can surround that code with 

$esc.html("#if($pdfExport == false)


The reason for this is that the PDF exporter is very picky about your markup.  You must make sure the markup is well formed and that you do not have HTML markup within Javascript.