Create a PDF version of your lesson using XSL-FO
Example of a PDF version (click image to download PDF)In eLML you have two possibilities to create a PDF version of your lesson: Via XSL-FO or via LaTeX. The first method is described below, the latter method is described in the LaTeX chapter. Both methods have their advantages and drawbacks. For the XSL-FO approach (using the open source Apache FOP to process the FO file) the following drawbacks are known:
- Both the Apache Formatting Object Parser (FOP) version 0.25 and 0.9 do not yet support the full range of XSL-FO commands which sometimes leads to layout errors.
- The layout of the PDF file is defined via XSL-FO commands and cannot be changed easily.
- The XSL-FO technique is generally spoken more complex and less known than LaTeX. But if you're fine with the included eLML transformation file (see PDF version of eLML website as an example) you don't have to care about this point anyway. Just go through the four steps below and you're done.
How to create a PDF version of your lesson:
- Open the "Introduction to Database Systems" lesson XML file in oXygen or XMLSpy.
- Have a look at the "print" section of your projects configuration file. With the $display_links parameter you can tell the parser if the full URL of links used in your lesson should be printed or not (they are clickable links in both cases but that of course only works if you look at your PDF on your computer). Furthermore you can define if hyphenation should be used, which Apache FOP version you are working with, etc.
- This time use the following XSLT file for transformation:
../../../../core/presentation/print/elml.xsl
- In your oXygen transformation scenario click the "Perform FO Processing" mark in the middle tab and enter a "real" output path. For example you can enter
${cfd}/${cfn}.pdf
and oXygen stores the PDF file in the same folder as your XML file.
Use the Template Builder to customize the look of your PDF file! If you want to adapt the look of your PDF file even more you will need to create your own eLML layout template for the FO-transformation. But beware: FO is not for the faint-hearted :-)
XMLSpy remark: With older versions the "pdf" button somehow does not work because it reports errors while transforming. But if you first create a "FO" file (using the XSLT transformation) and then process this file with the "PDF" button, then it works. I have no idea why it works in two steps but not in one. Any help is appreciated.