PdfDocument Example
The following example dynamically creates a PDF document based on an HTML document where the body consists of the output of the Lorem macro.
Various header and footer settings are applied and the document is secured with a password. The password implies that a user has to supply a password before being able to view the contents of the PDF document.
The PdfDocument macro is set in streaming mode which is the most efficient mode in terms of performance.
Smartsite SXML | Copy Code |
---|---|
<se:pdfdocument streaming="true"> <se:parameters> <se:parameter name="html"> <html> <body> <se:lorem unitcount="5" unittype="paragraph" /> </body> </html> </se:parameter> <se:parameter name="pdfsettings"> <pdf:pdfsettings xmlns:pdf="http://smartsite.nl/namespaces/pdf/1.0" > <!-- general PDF settings --> <pdf:documentoptions showheader="true" pdfpagesize="a5" pdfpageorientation="landscape" /> <!-- header settings --> <pdf:headeroptions headertext="Lorem Ipsum" /> <!-- footer settings --> <pdf:footeroptions showpagenumber="true" /> <!-- protects the document using a password --> <pdf:securityoptions userpassword="lorem" /> </pdf:pdfsettings> </se:parameter> </se:parameters> </se:pdfdocument> |