Template file for PDF Output

Fernando's Avatar

Fernando

31 Mar, 2015 06:22 PM

So I was trying to decide what would be the best route for facilitating my users with print options. I was thinking about adding a pdf output and follow the instructions posted in this link http://www.hannonhill.com/kb/Outputs/. One thing I notice is they talk about inserting the appropriate template:

"3. Once you have finished creating the new target and destination, return to the Home area and create/upload the appropriate template for the PDF version.
 
4. Attach the new template to its appropriate PDF target. For a PDF output, you will also need to attach a stylesheet to properly style the content. An example is found below."

And if adding a pdf output for my 6 different configuration sets i have across the site would I need to write a different template file for each configuration set? Or can I write one that could work for all 6 configuration sets?

Thanks for all of the help!

  1. 1 Posted by Ryan Griffith on 01 Apr, 2015 12:29 PM

    Ryan Griffith's Avatar

    Hi Fernando,

    If you wish to have all of the PDF outputs look the same (or similar), re-using the same Template is definitely a good idea from a maintenance and consistency standpoint. So, your PDF Output within your Configuration Sets would reference the same Template, but might have slightly different region setups depending on your needs.

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by Fernando on 01 Apr, 2015 01:11 PM

    Fernando's Avatar

    Is there a link or some kind of reference on how to create the pdf output? What I mean with that is how to create the template file and what velocity formats I need to write. Thanks! i am just new to this and I am not certain what exactly needs to happen with the pdf output.

  3. 3 Posted by Ryan Griffith on 01 Apr, 2015 02:21 PM

    Ryan Griffith's Avatar

    Hi Fernando,

    Setting up a PDF Output is very similar to setting up any other Output. So you would create a Template with the required markup and regions that you need and assign the desired Blocks and/or Formats to the regions.

    The main difference is the PDF output requires an additional XSLT Format applied to the Template or Output level that converts the rendered HTML into a PDF object using XSL-FO.

    We have a few examples of such a Format on Github (generally the xhtml2fo2pdf_with_TOC Format does the trick). If you would like more of a visual look at the setup, we also have a couple of example Sites containing sample PDF outputs you can import into your instance. Specifically, I know the course catalog has PDF outputs in it.

    One thing to keep in mind is that styling in PDF outputs is limited, so you definitely want to think printer friendly when deciding how things should look.

    Please let me know if you have any questions.

    Thanks!

  4. Ryan Griffith closed this discussion on 08 Apr, 2015 02:48 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac