Xarigami

projects

pdfgen

display
news
resources
dev notes
tracker
discuss
Project phase:
Iteration - unstable
Latest release [all releases]:
pdfgen 0.4.0 pdfgen 0.4.0 Aug 27, 2011
Development:
Latest snapshot build Latest snapshot build
Issue tracker:
Review or add issue

registered by

Jo on Feb 28, 2010 05:51:04 PM

summary

PDF Generator dynamically generates PDF files.

details

PDF Generator (pdfgen) is a utility module that dynamically generates a PDF file from HTML. It makes use of a number of backends to do the PDF Generation providing flexibility for the user. There is no need for installation of additional server modules to generate the PDFs although they will be used if available.

Two basic methods are used namely DomPDF which uses the theme CSS to dictate the PDF look and layout. DomPDF will also take advantage of PDFLib, and GD if available. TCPDF is also a provided backend and this relies more on the user defining page attribtues in the configuration.

features

PDFGenerator comes with a custom tag that can be added to whatever page you require a PDF generated.

  1. The default tag can be simply added to any page and provides a PDF icon with link to generate the PDF:
    <xar:pdfgen-render />
  2. The tag will use the Print theme by default and the current URL for rendering the PDF.
  3. Options for the tag include:
    • theme: Select the theme providing output and CSS for your PDF <xar:pdfgen-render theme="mytheme" />
    • pdfmethod: builds a page based on either TCPDF or DomPDF (including CPDF, TCPDF, GD, PDFLib)  <xar:pdfgen-render pdfmethod="TCPDF_DIRECT" />
    • text: Add your custom text to the link <xar:pdfgen-render type="text" text="Download a PDF" /> A pdf icon is used as default.
    • pdfname: Name of the pdf file generated <xar:pdfgen-render pdfname="Your Invoice" />
    • inputfile: Pass in the full URL you wish to render as PDF including the theme name <xar:pdfgen-render inputfile="http://mysite.com/myfile/?theme=foo" />
    • author: Pass in the name of the author

Alternatively you can add a link directy in the page and call the main pdfgen function:

<a href="#xarModURL('pdfgen','user','main',
array('inputfile'=>xarServerGetCurrentURL(array('theme' =>'half-full'),false)))#">PDF</a>

requirements

  • Xarigami core 1.4.0
  • PHP5.2 or above
  • DOM/XML enabled in your PHP

install & usage

  • Install module in usual way, ensure the module is active in the Module listing
  • The default will work out of the box using TCPDF backend.
  • To add a clickable icon to generate and download a PDF document, add the following tag in eg your article display template:<xar:pdfgen-render />
  • Browse to your article display and wait for PDF to generate and download.

This is default action. Much more granular page output and features can be created for a specific PDF output using the configuration settings in the admin interface or the custom pdfgen tags in your templates. Please see the pdfGen overview once it is installed.

todo

Expand configuration settings especially for TCPDF.

status

V 0.4.0 plus development code in the development snapshot area.

file releases:

  • pdfgen 0.4.0 on Aug 27, 2011
    Dynamic PDF generation for xarigami

last updated 28 Aug 11 07:48


useful? share it.