| Skip over navigation | PythonPointThe apex/examples/pythonpoint directory contains an application for generating slide presentations in Portable Document Format (PDF) from XML. This application produces the same results as ReportLab's “PythonPoint” tool, which converts XML markup into PDF slides. However, this application uses a DTD that is more author-friendly than the PythonPoint DTD. The application's DTD uses the PythonPoint DTD as an architecture in order to enable data conforming to the application DTD to be processed using PythonPoint. To see how much more author-friendly the application DTD is than the PythonPoint DTD, consider the following data from a document conforming to the application DTD:
<slide title="Slide 1">
<frame>
<heading>Body text and bullets</heading>
<bodytext>Here is some body text.</bodytext>
<bodytext>Here are some bullets:</bodytext>
<bullet>Bullet</bullet>
<bullet><i>Another</i> bullet</bullet>
</frame>
</slide>
The same data represented using the PythonPoint DTD would look as follows:
<slide effectduration="1" effectmotion="I"
effectdimension="H" effectdirection="0" effectname="Wipe"
showIDName="true" title="Slide 1">
<frame x="100" border="false" bottommargin="0"
topmargin="0" rightmargin="72" leftmargin="72" height="504"
width="648" y="0">
<para style="Heading1">Body text and bullets</para>
<para style="BodyText">Here is some body text.</para>
<para style="BodyText">Here are some bullets:</para>
<para style="Bullet">Bullet</para>
<para style="Bullet"><i>Another</i> bullet</para>
</frame>
</slide>
The application consists of the following files:
The file presentation.xml contains data valid with respect to ppointarch.dtd. Issuing the following command: python ppointarch.py presentation.xml should cause a PDF slide presentation file presentation.pdf to be created. To run ppointarch.py, you must have ReportLab and the Python bindings for the GNOME XML libraries installed as Python modules. To obtain additional documentation for ppointarch.py (including usage instructions), use Python's pydoc utility. |