[Checkins] SVN: z3c.pdftemplate/trunk/src/z3c/pdftemplate/ Major refactoring of PDF Template

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Mar 14 18:39:25 EDT 2007


Log message for revision 73177:
  Major refactoring of PDF Template
  
  * Removed PML, rlpdf, and trml2pdf. This measn no more non-ZPL code in the 
    package.
  
  * Removed the functionality to render using PML and to render REST 
    altogether. After consulting with the people using this package heavily it 
    turned out that nobody was using the stuff anyways.
  
  * Integrated z3c.rml into the package as the RML to PDF converter.
  
  * Adjusted samples to work with this flavor of RML.
  
  

Changed:
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/DEPENDENCIES.cfg
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/LICENSES.txt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/README.txt
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/ZopePublicLicense.txt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/configure.zcml
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/meta.zcml
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/metaconfigure.py
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/metadirectives.py
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/pdf.py
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/pml2pdf/
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/rest.py
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/rlpdf/
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/rml.py
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex05.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex11.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex12.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex13.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex14.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/micromeshfoto.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/micromeshprot.pt
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/pml_contents.pt
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/pml_template.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/raylprot.pt
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rest.txt
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rest_template.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rollcard.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/thicknessprot.pt
  U   z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample.zcml
  D   z3c.pdftemplate/trunk/src/z3c/pdftemplate/trml2pdf/
  A   z3c.pdftemplate/trunk/src/z3c/pdftemplate/zcml.py

-=-
Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/DEPENDENCIES.cfg
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/DEPENDENCIES.cfg	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/DEPENDENCIES.cfg	2007-03-14 22:39:24 UTC (rev 73177)
@@ -7,3 +7,4 @@
 zope.publisher
 zope.schema
 zope.testing
+z3c.rml

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/LICENSES.txt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/LICENSES.txt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/LICENSES.txt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,81 +0,0 @@
-========
-LICENSES
-========
-
-The contents of this package is distributed under ZPL 2.1. See
-``ZopePublicLicense.txt``.
-
-
-pml2pdf
--------
-
-The code in the ``pml2pdf`` package was developed by Ulrich Eck and is
-distributed under the GNU Lesser General Public License (LGPL). He included a
-modified file from reportlab, which is available under the following
-conditions:
-
-###############################################################################
-#
-# Copyright (c) 2000-2001, ReportLab Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#   * Redistributions of source code must retain the above copyright notice,
-#     this list of conditions and the following disclaimer.
-#   * Redistributions in binary form must reproduce the above copyright notice,
-#     this list of conditions and the following disclaimer in the documentation
-#     and/or other materials provided with the distribution.
-#   * Neither the name of the company nor the names of its contributors may be
-#     used to endorse or promote products derived from this software without
-#     specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE OFFICERS OR CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-#
-###############################################################################
-
-
-rlpdf
------
-
-The code in ``rlpdf`` is partially put in the Public domain and includes code
-also subject to the above conditions. Thanks dreamcatcher!
-
-
-trml2pdf
---------
-
-The code of Tiny RML2PDF package is distributed under the GNU Lesser General
-Public License (LGPL)..
-
-###############################################################################
-#
-# trml2pdf - An RML to PDF converter
-# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-###############################################################################

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/README.txt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/README.txt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/README.txt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -19,274 +19,17 @@
   >>> context = xmlconfig.file('meta.zcml', package=z3c.pdftemplate)
 
 
-PML to PDF Views
-----------------
-
-PML, an XML-dialect developed by Ulrich Eck, is much like HTML in that it lets
-you define the structure of a PDF document. The PML is dynamically generated
-using page templates and then used to generate a PDF file.
-
-Let's say we want to create a PDF that shows the contents of a folder. The
-first step is to create a document template that contains the structure of the
-PDF. The following folder contents document template is available in
-``folder_contents.pt``::
-
-  <?xml version="1.0" encoding="iso-8859-15"?>
-  <document
-      xmlns:tal="http://xml.zope.org/namespaces/tal"
-      xmlns:metal="http://xml.zope.org/namespaces/metal"
-      filename="contents.pdf">
-  <content>
-
-  <para style="FolderName">
-    Folder Name:
-    <tal:block
-       condition="context/zope:name"
-       replace="context/zope:name|default" />
-    <tal:block condition="not:context/zope:name">&lt;no name&gt;</tal:block>
-  </para>
-
-  <spacer height="30" />
-
-  <table splitbyrow="1" repeatrows="0" repeatcols="0" style="ContentTable">
-    <tr>
-      <td>Name</td>
-      <td>Title</td>
-      <td>Size</td>
-      <td>Created</td>
-      <td>Modified</td>
-    </tr>
-    <tr tal:repeat="item view/listContentInfo">
-      <td tal:content="item/id">me.png</td>
-      <td tal:content="item/title|default">&lt;no title&gt;</td>
-      <td tal:content="item/size/sizeForDisplay|nothing">34.5 kB</td>
-      <td tal:content="item/created|default"></td>
-      <td tal:content="item/modified|default"></td>
-    </tr>
-  </table>
-
-  <action name="frameEnd" />
-
-  </content>
-  </document>
-
-Pretty easy isn't it? Fortunately, we can simply reuse the ``Contents`` view
-class for the HTML contents view. Now that we have defined the document, we
-have to create a PDF template, so that the table will look nice. The following
-template code can be found in ``folder_template.pt``::
-
-  <?xml version="1.0" encoding="utf-8"?>
-  <template
-      filename="contents.pdf"
-      pagesize="A4"
-      landscape="0"
-      showboundary="0"
-      leftmargin="1cm"
-      rightmargin="1cm"
-      topmargin="1cm"
-      bottommargin="1cm"
-      allowsplitting="1">
-
-    <stylesheet>
-
-     <paragraphstyle
-         name="Base"
-         fontName="Helvetica"
-         fontSize="10"
-         align="LEFT"
-         firstLineIndent="0cm"
-         leftIndent="0.5cm"
-         rightIndent="0cm"
-         spaceBefore="0"
-         spaceAfter="0"
-         leading="0.5cm"
-         bulletFontName="Helvetica"
-         bulletIndent="0cm"
-         bulletFontSize="10" />
-
-     <paragraphstyle
-         name="FolderName"
-         parent="Base"
-         leftIndent="0cm"
-         fontName="Helvetica-Bold"
-         fontSize="16"
-         leading="0.5cm"
-         spaceBefore="4"
-         spaceAfter="4" />
-
-     <tablestyle name="ContentTable">
-       <stylecmd expr="('LEFTPADDING', (0,0), (-1,-1), 5)"/>
-       <stylecmd expr="('RIGHTPADDING', (0,0), (-1,-1), 5)"/>
-       <stylecmd expr="('TOPPADDING', (0,0), (-1,-1), 3)"/>
-       <stylecmd expr="('BOTTOMPADDING', (0,0), (-1,-1), 7)"/>
-       <stylecmd expr="('ALIGN', (0,0), (-1,-1), 'LEFT')"/>
-       <stylecmd expr="('GRID', (0,0), (-1,-1), 0.5, colors.black)"/>
-       <stylecmd expr="('BOX', (0,0), (-1,-1), 1, colors.black)"/>
-       <stylecmd expr="('FONT', (1,1), (-1,-1), 'Helvetica', 10)"/>
-       <stylecmd expr="('FONT', (0,0), (-1,0), 'Helvetica-Bold', 10)"/>
-       <stylecmd expr="('FONT', (0,1), (0,-1), 'Courier', 10)"/>
-     </tablestyle>
-
-    </stylesheet>
-
-
-    <pagetemplate id="Page" >
-      <static>
-        <infostring
-            align="left"
-            x="5cm"
-            y="28cm"
-            size="10"
-  	  font="Helvetica"
-            color="(0, 0, 0)">
-          The development of the PDF Template Code was sposored by Projekt01.
-        </infostring>
-      </static>
-
-      <frame
-          id="content"
-     	nextid="content"
-      	x="2cm"
-          y="1.5cm"
-  	width="17cm"
-  	height="25.5cm"
-  	leftpadding="0.1cm"
-  	rightpadding="0.1cm"
-  	toppadding="0.5cm"
-  	bottompadding="0.5cm"
-  	showBoundary="0" />
-    </pagetemplate>
-
-  </template>
-
-Now that we have the template and the document, we can simply register the
-view:
-
-  >>> context = xmlconfig.string("""
-  ...     <configure xmlns:browser="http://namespaces.zope.org/browser">
-  ...       <browser:pml2pdf
-  ...           name="sample_pml.pdf"
-  ...           for="zope.app.folder.interfaces.IFolder"
-  ...           template="sample/pml_template.pt"
-  ...           document="sample/pml_contents.pt"
-  ...           class="zope.app.container.browser.contents.Contents"
-  ...           permission="zope.Public"
-  ...           />
-  ...     </configure>
-  ...     """, context)
-
-Once we have created a folder instance:
-
-  >>> from zope.app.folder.folder import Folder
-  >>> folder = Folder()
-  >>> folder.__name__ = 'my folder'
-  >>> folder['subFolder'] = Folder()
-
-we can can look up the view
-
-  >>> class Principal:
-  ...   id = 'bob'
-
-  >>> request = TestRequest()
-  >>> request.setPrincipal(Principal())
-
-  >>> contents = zapi.getMultiAdapter((folder, request),
-  ...                                 name="sample_pml.pdf")
-
-and create the PDF:
-
-  #>>> contents() #doctest: +ELLIPSIS
-  #'%PDF-1.3...'
-
-Again, you cannot just register any template for the document. The styles that
-are used in the document *must* be declared in the PDF template. In the
-following case we are not specifying any template, so that the generic
-template is used, which does not have the right styles defined:
-
-  >>> context = xmlconfig.string("""
-  ...     <configure xmlns:browser="http://namespaces.zope.org/browser">
-  ...       <browser:pml2pdf
-  ...           name="contents2.pdf"
-  ...           for="zope.app.folder.interfaces.IFolder"
-  ...           document="sample/pml_contents.pt"
-  ...           class="zope.app.container.browser.contents.Contents"
-  ...           permission="zope.Public"
-  ...           />
-  ...     </configure>
-  ...     """, context)
-
-  >>> contents = zapi.getMultiAdapter((folder, request),
-  ...                                 name="contents2.pdf")
-  >>> contents()
-  Traceback (most recent call last):
-  ...
-      stylesheet[self.style],
-  KeyError: 'FolderName'
-
-
-Generic PDF Views
------------------
-
-Sometimes, however, you do not want to use PML to structure your content, but
-use the reportlab API directly. But you still want to use the template
-mechanism. For these cases there is a very simple directive that requires you
-to implement a view class yourself. Let's use the simplest case possible and
-create a PDF that returns an empty page.
-
-The first step is to create the view class:
-
-  >>> from StringIO import StringIO
-  >>> class NullPage(object):
-  ...
-  ...     def __call__(self):
-  ...         buffer = StringIO()
-  ...         template = self.getPDFTemplate()
-  ...         template.build([], buffer)
-  ...
-  ...         self.request.response.setHeader('content-type', 'application/pdf')
-  ...         return buffer.getvalue()
-
-We have to add the class to a loadable module:
-
-  >>> z3c.pdftemplate.tests.NullPage = NullPage
-
-Next we register the view:
-
-  >>> context = xmlconfig.string("""
-  ...     <configure xmlns:browser="http://namespaces.zope.org/browser">
-  ...       <browser:pdf
-  ...           name="null.pdf"
-  ...           for="*"
-  ...           class="z3c.pdftemplate.tests.NullPage"
-  ...           permission="zope.Public"
-  ...           />
-  ...     </configure>
-  ...     """, context)
-
-  >>> contents = zapi.getMultiAdapter((None, request), name="null.pdf")
-  >>> print contents() #doctest: +ELLIPSIS
-  %PDF-1.3...
-
-Doing some cleanup:
-
-  >>> del z3c.pdftemplate.tests.NullPage
-
-
+Using ``z3c.rml`` and ReportLab to generate PDF Views
 =====================================================
-Using TinyRML2PDF and ReportLab to generate PDF Views
-=====================================================
 
-See ../INSTALL.txt and DEPENDENCIES.cfg, this lib depends on some 3rd party
-libraries.
+See DEPENDENCIES.cfg, this lib depends on some 3rd party libraries.
 
 
-Purpose: PDF-Generration with the help of TinyRML (an open source implementation
-of RML) and Reportlab.
+Purpose: PDF-Generration with the help of ``z3c.rml`` (an open source
+implementation of RML) and Reportlab. The ``z3c.rml`` is really a dialect of
+the official RML and supports many more features, such as charting while still
+remaining compatible with the commercial version of RML as much as possible.
 
-We did some customizing in the RML-Language, so its possible to produce Chart
-directly.
-
-
 This package provides the functionality of creating browser views that
 generate PDFs instead of HTML using reportlab's PDF writer technology.
 
@@ -295,12 +38,10 @@
   >>> from zope.configuration import xmlconfig
   >>> context = xmlconfig.file('meta.zcml', package=z3c.pdftemplate)
 
-
 RML, an XML-dialect developed by Reportlab.org, is much like HTML in that it
 lets you define the structure of a PDF document. The RML is dynamically
 generated using page templates and then used to generate a PDF file.
 
-
 Let's say we want to create a PDF that shows the contents of a folder. The
 first step is to create a rml-document that contains the structure of the
 PDF. The following folder contents document template is available in
@@ -359,7 +100,7 @@
   ...       <browser:rml2pdf
   ...           name="rmlsample.pdf"
   ...           for="zope.app.folder.interfaces.IFolder"
-  ...           document="sample/rml_contents.pt"
+  ...           template="sample/rml_contents.pt"
   ...           class="zope.app.container.browser.contents.Contents"
   ...           permission="zope.Public"
   ...           />
@@ -388,59 +129,3 @@
 
   >>> contents() #doctest: +ELLIPSIS
   '%PDF-1.3...'
-
-
-ReST to PDF Resources
----------------------
-
-Using the ``browser:rest2pdf`` directive, you simply specify an ReST file, and
-the resource is available. For example, let's make a PDF out of this file:
-
-  >>> context = xmlconfig.string("""
-  ...     <configure xmlns:browser="http://namespaces.zope.org/browser">
-  ...       <browser:rest2pdf
-  ...           name="pdftemplate.pdf"
-  ...           path="sample/rest.txt"
-  ...           />
-  ...     </configure>
-  ...     """, context)
-
-  >>> resource = zapi.getAdapter(TestRequest(), name="pdftemplate.pdf")
-  >>> resource()
-  '%PDF-1.3...'
-
-Optionally, you can specify your custom PDF template as well:
-
-  >>> context = xmlconfig.string("""
-  ...     <configure xmlns:browser="http://namespaces.zope.org/browser">
-  ...       <browser:rest2pdf
-  ...           name="pdftemplate2.pdf"
-  ...           path="sample/rest.txt"
-  ...           template="sample/rest_template.pt"
-  ...           />
-  ...     </configure>
-  ...     """, context)
-
-  >>> resource = zapi.getAdapter(TestRequest(), name="pdftemplate2.pdf")
-  >>> resource() #doctest: +ELLIPSIS
-  '%PDF-1.3...'
-
-But be careful, the template needs to contain specially named styles, so that
-not any arbitrary template will work:
-
-  >>> context = xmlconfig.string("""
-  ...     <configure xmlns:browser="http://namespaces.zope.org/browser">
-  ...       <browser:rest2pdf
-  ...           name="pdftemplate3.pdf"
-  ...           path="sample/rest.txt"
-  ...           template="sample/generic_template.pt"
-  ...           />
-  ...     </configure>
-  ...     """, context)
-
-  >>> resource = zapi.getAdapter(TestRequest(), name="pdftemplate3.pdf")
-  >>> resource()
-  Traceback (most recent call last):
-  ...
-      style = self.styleSheet[in_style]
-  KeyError: 'h1'

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/ZopePublicLicense.txt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/ZopePublicLicense.txt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/ZopePublicLicense.txt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,54 +0,0 @@
-Zope Public License (ZPL) Version 2.1
--------------------------------------
-
-A copyright notice accompanies this license document that
-identifies the copyright holders.
-
-This license has been certified as open source. It has also
-been designated as GPL compatible by the Free Software
-Foundation (FSF).
-
-Redistribution and use in source and binary forms, with or
-without modification, are permitted provided that the
-following conditions are met:
-
-1. Redistributions in source code must retain the
-   accompanying copyright notice, this list of conditions,
-   and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the accompanying
-   copyright notice, this list of conditions, and the
-   following disclaimer in the documentation and/or other
-   materials provided with the distribution.
-
-3. Names of the copyright holders must not be used to
-   endorse or promote products derived from this software
-   without prior written permission from the copyright
-   holders.
-
-4. The right to distribute this software or to use it for
-   any purpose does not give you the right to use
-   Servicemarks (sm) or Trademarks (tm) of the copyright
-   holders. Use of them is covered by separate agreement
-   with the copyright holders.
-
-5. If any files are modified, you must cause the modified
-   files to carry prominent notices stating that you changed
-   the files and the date of any change.
-
-Disclaimer
-
-  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS''
-  AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
-  NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
-  NO EVENT SHALL THE COPYRIGHT HOLDERS BE
-  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-  DAMAGE.

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/configure.zcml
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/configure.zcml	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/configure.zcml	2007-03-14 22:39:24 UTC (rev 73177)
@@ -8,11 +8,11 @@
 
     <apidoc:rootModule module="z3c.pdftemplate"  />
 
-  <apidoc:bookchapter 
-      id="pdf"
-      title="PDF Resources and Views"
-      doc_path="README.txt"
-      />
+    <apidoc:bookchapter
+        id="pdf"
+        title="PDF Resources and Views"
+        doc_path="README.txt"
+        />
 
   </configure>
 

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/meta.zcml
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/meta.zcml	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/meta.zcml	2007-03-14 22:39:24 UTC (rev 73177)
@@ -6,27 +6,9 @@
   <meta:directives namespace="http://namespaces.zope.org/browser">
 
     <meta:directive
-        name="pdf"
-        schema=".metadirectives.IPDFDirective"
-        handler=".metaconfigure.pdf"
-        />
-        
-    <meta:directive
-        name="pml2pdf"
-        schema=".metadirectives.IPMLToPDFDirective"
-        handler=".metaconfigure.pml2pdf"
-        />
-
-    <meta:directive
-        name="rest2pdf"
-        schema=".metadirectives.IReSTToPDFDirective"
-        handler=".metaconfigure.rest2pdf"
-        />
-        
-    <meta:directive
         name="rml2pdf"
-        schema=".metadirectives.IRMLToPDFDirective"
-        handler=".metaconfigure.rml2pdf"
+        schema=".zcml.IRMLToPDFDirective"
+        handler=".zcml.rml2pdf"
         />
 
   </meta:directives>

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/metaconfigure.py
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/metaconfigure.py	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/metaconfigure.py	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,131 +0,0 @@
-# -*- coding: utf-8 -*-
-###############################################################################
-#
-# Copyright (c) 2005 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-###############################################################################
-"""Directive Handler for several PDF generating presentation components
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-
-import os.path
-
-from zope.configuration.exceptions import ConfigurationError
-from zope.publisher.interfaces.browser import IDefaultBrowserLayer
-from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from zope.app.publisher.browser.resourcemeta import resource
-from zope.app.publisher.browser.viewmeta import page
-
-import z3c.pdftemplate
-from z3c.pdftemplate.pdf import PDFView
-from z3c.pdftemplate.pml import PML2PDFView
-from z3c.pdftemplate.rest import ReSTPDFResourceFactory
-from z3c.pdftemplate.rml import RML2PDFView
-
-
-def getTemplatePath(_context, template, default='sample/generic_template.pt'):
-    """Return the path of the PDF template."""
-    if template is None:
-        template = os.path.join(
-            os.path.dirname(z3c.pdftemplate.__file__), default)
-
-    template = os.path.abspath(str(_context.path(template)))
-    if not os.path.isfile(template):
-        raise ConfigurationError("No such file", template)
-    return template
-
-
-def pdf(_context, name, permission, for_, class_,
-        template=None, layer=IDefaultBrowserLayer,
-        allowed_interface=None, allowed_attributes=None,
-        menu=None, title=None):
-
-    template = getTemplatePath(_context, template)
-
-    if PDFView not in class_.__bases__:
-        bases = (class_, PDFView)
-    else:
-        bases = (class_,)
-
-    factory = type(
-        'PDFView using template=%s' %template,
-        bases, {'template': ViewPageTemplateFile(template)} )
-
-    page(_context, name, permission, for_, layer, None, factory,
-         allowed_interface, allowed_attributes, '__call__', menu, title)
-
-
-def pml2pdf(_context, name, permission, for_, document,
-            template=None, layer=IDefaultBrowserLayer, class_=PML2PDFView,
-            allowed_interface=None, allowed_attributes=None,
-            menu=None, title=None):
-
-    template = getTemplatePath(_context, template)
-
-    document = os.path.abspath(str(_context.path(document)))
-    if not os.path.isfile(document):
-        raise ConfigurationError("No such file", document)
-
-    if class_ is not PML2PDFView and PML2PDFView not in class_.__bases__:
-        bases = (class_, PML2PDFView)
-    else:
-        bases = (class_,)
-
-    factory = type(
-        'PML2PDFView from template=%s, document=%s' %(template, document),
-        bases,
-        {'template': ViewPageTemplateFile(template),
-         'document': ViewPageTemplateFile(document)}
-        )
-
-    page(_context, name, permission, for_, layer, None, factory,
-         allowed_interface, allowed_attributes, '__call__', menu, title)
-
-
-def rest2pdf(_context, name, path,
-             template=None,
-             layer=IDefaultBrowserLayer, permission='zope.Public'):
-
-    template = getTemplatePath(_context, template, 'sample/rest_template.pt')
-
-    path = os.path.abspath(str(_context.path(path)))
-    if not os.path.isfile(path):
-        raise ConfigurationError("No such file", path)
-
-    factory = ReSTPDFResourceFactory(path, ViewPageTemplateFile(template))
-
-    resource(_context, name, layer, permission, factory)
-
-    
-def rml2pdf(_context, name, permission, for_, document,
-            layer=IDefaultBrowserLayer, class_=RML2PDFView,
-            allowed_interface=None, allowed_attributes=None,
-            menu=None, title=None):
-
-    document = os.path.abspath(str(_context.path(document)))
-    if not os.path.isfile(document):
-        raise ConfigurationError("No such file", document)
-
-    if class_ is not RML2PDFView and RML2PDFView not in class_.__bases__:
-        bases = (class_, RML2PDFView)
-    else:
-        bases = (class_,)
-
-    factory = type(
-        'RML2PDFView from document=%s' %(document),
-        bases,
-        {'document': ViewPageTemplateFile(document)}
-        )
-
-    page(_context, name, permission, for_, layer, None, factory,
-         allowed_interface, allowed_attributes, '__call__', menu, title)    

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/metadirectives.py
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/metadirectives.py	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/metadirectives.py	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,111 +0,0 @@
-# -*- coding: utf-8 -*-
-###############################################################################
-#
-# Copyright (c) 2005 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-###############################################################################
-"""``pdf`` directive for generating PDFs from PML
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-
-from zope.interface import Interface
-from zope.schema import TextLine
-from zope.configuration.fields import Path
-from zope.app.publisher.browser.metadirectives import IViewDirective
-from zope.app.publisher.browser.metadirectives import IBasicResourceInformation
-
-
-class IPDFBaseDirective(Interface):
-    """Base directive for PDF-generating browser views.
-
-    All PDF-generating components of this package require some information on
-    how to layout the PDF page, such as the page layout and style sheet. All
-    of this information is contained in a PML-based template.
-    """
-    template = Path(
-        title=u"PML Template Page Template",
-        description=u"""
-        Refers to a file containing a page template that will generate the
-        PML template/style file for PDF generation.""",
-        required=False
-        )
-
-class IPDFDirective(IPDFBaseDirective, IViewDirective):
-    """A simple view directive that generates PDFs.
-
-    Most of the work is up to the view class you are providing, since you have
-    to specify how the PDF is generated. The only help you are getting is that
-    the PDF layout template is generated for you.
-    """
-
-class IPMLToPDFDirective(IPDFDirective):
-    """A view directive that dynamically evaluates a PML document and converts
-    it to PDF.
-
-    This directive behaves very much like the ``page`` directive, except that
-    it does not generate HTML, but PML that is rendered to PDF for output. PML
-    is a simple XML-dialect that creates a storyboard for the reportlab PDF
-    rendering engine.
-    """
-
-    document = Path(
-        title=u"PML Document Page Template",
-        description=u"""
-        Refers to a file containing a page template that will generate the
-        PML data file for PDF generation.""",
-        required=True
-        )
-
-class IReSTToPDFDirective(IPDFBaseDirective, IBasicResourceInformation):
-    """A resource directive that converts ReST documents to PDF.
-
-    All you basically need to do is specify a the path to the ReST file. If
-    you do not provide your own template file, a sensible default PDF template
-    is provided.
-    """
-
-    name = TextLine(
-        title=u"The name of the resource",
-        description=u"""
-        This is the name used in resource urls. Resource urls are of
-        the form site/@@/resourcename, where site is the url of
-        "site", a folder with a site manager.
-
-        We make resource urls site-relative (as opposed to
-        content-relative) so as not to defeat caches.""",
-        required=True
-        )
-
-    path = Path(
-        title=u"Path of the ReST File",
-        description=u"""Refers to the path of the ReST file.""",
-        required=True
-        )
-
-class IRMLToPDFDirective(Interface, IViewDirective):
-    """A view directive that dynamically evaluates a RML document and converts
-    it to PDF.
-
-    This directive behaves very much like the ``page`` directive, except that
-    it does not generate HTML, but RML that is rendered to PDF for output. RML
-    is a simple XML-dialect that creates a storyboard for the reportlab PDF
-    rendering engine.
-    """
-
-    document = Path(
-        title=u"RML Document Page Template",
-        description=u"""
-        Refers to a file containing a page template that will generate the
-        RML data file for PDF generation.""",
-        required=True
-        )  
\ No newline at end of file

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/pdf.py
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/pdf.py	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/pdf.py	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,59 +0,0 @@
-# -*- coding: utf-8 -*-
-###############################################################################
-#
-# Copyright (c) 2005 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-###############################################################################
-"""PDF generation base classes
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-
-import xml.dom.minidom
-from StringIO import StringIO
-from zope.publisher.browser import BrowserView
-from z3c.pdftemplate.pml2pdf.Parser import TemplateParser
-
-class ResourceHandler:
-    """Wrapper to allow loading from external resources.
-
-    The implementation forbids local file access for security reasons.
-    """
-
-    def get(self, url, data=None):
-        url = str(url)
-        if url.startswith('file:'):
-            raise urllib2.URLError, \
-                  'The file: protocol is disabled for security'
-        fd = self.opener.open(url, data)
-        return StringIO(fd.read())
-
-
-class PDFTemplateGenerator(object):
-
-    template = None
-
-    def getPDFTemplate(self):
-        # create the PDFTemplate from xml
-        template_xml = self.template(self).encode('utf-8')
-        template_dom = xml.dom.minidom.parseString(template_xml)
-        template = TemplateParser(template_dom, 'utf-8', ResourceHandler())()
-        # Boilerplate from PML :(
-        template.title = ''
-        template.author = ''
-        template.subject = ''
-        return template
-
-
-class PDFView(PDFTemplateGenerator, BrowserView):
-    """Base-class for objects rendering PDFs using a template."""
-    pass

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/rest.py
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/rest.py	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/rest.py	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,92 +0,0 @@
-# -*- coding: utf-8 -*-
-###############################################################################
-#
-# Copyright (c) 2005 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-###############################################################################
-"""ReST-to-PDF Resources
-
-$Id$
-"""
-__docformat__ = "reStructuredText"
-
-import xml.dom.minidom
-from docutils.core import publish_string
-from StringIO import StringIO
-
-from zope.interface import implements
-from zope.app.publisher.browser.resource import Resource
-from zope.publisher.interfaces.browser import IBrowserPublisher
-
-import z3c.pdftemplate.rlpdf.rlpdf
-from z3c.pdftemplate.pml2pdf.Parser import DocumentParser
-from z3c.pdftemplate.pdf import PDFTemplateGenerator
-
-
-class PDFWriter(z3c.pdftemplate.rlpdf.rlpdf.Writer):
-
-    def __init__(self, template):
-        z3c.pdftemplate.rlpdf.rlpdf.Writer.__init__(self)
-        self.doc = template
-        self.doc.subject = ''
-
-    def translate(self):
-        visitor = self.translator_class(self.document)
-        visitor.styleSheet = self.doc.getStyleSheet()
-        self.document.walkabout(visitor)
-        self.story = visitor.as_what()
-        self.output = self.record()
-
-    def record(self):
-        out = StringIO()
-        self.doc.filename = out
-        self.doc.build(self.story)
-        return out.getvalue()
-
-class ReSTPDFResource(PDFTemplateGenerator, Resource):
-
-    implements(IBrowserPublisher)
-
-    def __init__(self, path, template, request):
-        self.path = path
-        self.template = template
-        self.request = request
-        # Needed for the page template view class
-        self.context = template
-
-    def publishTraverse(self, request, name):
-        '''See interface IBrowserPublisher'''
-        raise NotFound(None, name)
-
-    def browserDefault(self, request):
-        '''See interface IBrowserPublisher'''
-        return self, ()
-
-    def __call__(self):
-        template = self.getPDFTemplate()
-        pdf = publish_string(open(self.path, 'r').read(),
-                             writer=PDFWriter(template))
-
-        # Set the content type to application/pdf
-        self.request.response.setHeader('content-type', 'application/pdf')
-        
-        return pdf
-
-
-class ReSTPDFResourceFactory(object):
-    """A factory that generates PDF generating resource."""
-
-    def __init__(self, path, template):
-        self.__path = path
-        self.__template = template
-
-    def __call__(self, request):
-        return ReSTPDFResource(self.__path, self.__template, request)

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/rml.py
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/rml.py	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/rml.py	2007-03-14 22:39:24 UTC (rev 73177)
@@ -18,40 +18,15 @@
 """
 __docformat__ = "reStructuredText"
 
-from StringIO import StringIO
+import cStringIO
 from zope.publisher.browser import BrowserPage
-from z3c.pdftemplate import trml2pdf
+from z3c.rml import rml2pdf
 
+class RML2PDFView(BrowserPage):
 
-class ResourceHandler:
-    """Wrapper to allow loading from external resources.
-
-    The implementation forbids local file access for security reasons.
-    """
-
-    def get(self, url, data=None):
-        url = str(url)
-        if url.startswith('file:'):
-            raise urllib2.URLError, \
-                  'The file: protocol is disabled for security'
-        fd = self.opener.open(url, data)
-        return StringIO(fd.read())
-
-class PDFTemplateGenerator(object):
-
     template = None
 
-    def getPDFTemplate(self):
-        return self.template(self).encode('iso-8859-1')
-
-class RML2PDFView(PDFTemplateGenerator, BrowserPage):
-
-    document = None
-
     def __call__(self):
-
-        rmldocument = self.document(self).encode('iso-8859-1')
-
+        rml = self.template(self).encode('iso-8859-1')
         self.request.response.setHeader('content-type', 'application/pdf')
-
-        return trml2pdf.parseString(rmldocument)
+        return rml2pdf.parseString(rml).read()

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex05.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex05.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex05.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -9,7 +9,7 @@
           title="Example 5 - templates and pageTemplates"
           author="Reportlab Inc (Documentation Team)"
           showBoundary="1"
-          allowSplitting="20"
+          allowSplitting="true"
           >
           <!-- showBoundary means that we will be able to see the            -->
           <!-- limits of frames                                              -->

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex11.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex11.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex11.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,16 +1,13 @@
 <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> 
 <!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
 <document filename="sample.pdf"> 
-<template pageSize="(210mm, 297mm)" 
-        leftMargin="12mm" 
-        rightMargin="10mm" 
-        topMargin="10mm" 
-        bottomMargin="10mm" 
-        title="Example 5 - templates and pageTemplates" 
-        author="Reportlab Inc (Documentation Team)" 
-        showBoundary="0" 
-        >
-</template>
+  <template>
+    <pageTemplate id="main">
+      <pageGraphics>
+      </pageGraphics>
+      <frame id="first" x1="72" y1="72" width="451" height="698"/>
+    </pageTemplate>
+  </template>
 <stylesheet>
      <blockTableStyle id="myBlockTableStyle">
           <!-- Set fonts -->

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex12.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex12.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex12.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -54,7 +54,7 @@
      <blockTable style="myBlockTableStyle" rowHeights="166,28,166,28,166,28" colWidths="161,161,161">
 <tr>
        <td><illustration width="141" height="90">
-                <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+                <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
                 <stroke color="deepskyblue"/>
                 <lineMode width="3"/>
                 <lines>
@@ -66,7 +66,7 @@
             </illustration>
        </td>
        <td><illustration width="141" height="90">
-                <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+                <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
                 <stroke color="deepskyblue"/>
                 <lineMode width="3"/>
                 <lines>
@@ -78,7 +78,7 @@
             </illustration>
        </td>
        <td><illustration width="141" height="90">
-                <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+                <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
                 <stroke color="deepskyblue"/>
                 <lineMode width="3"/>
                 <lines>
@@ -109,7 +109,7 @@
     </tr>
     <tr>
        <td><illustration width="141" height="90">
-                <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+                <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
                 <stroke color="deepskyblue"/>
                 <lineMode width="3"/>
                 <lines>
@@ -121,7 +121,7 @@
             </illustration>
    </td>
    <td><illustration width="141" height="90">
-           <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+           <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
            <stroke color="deepskyblue"/>
            <lineMode width="3"/>
            <lines>
@@ -133,7 +133,7 @@
        </illustration>
    </td>
    <td><illustration width="141" height="90">
-           <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+           <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
            <stroke color="deepskyblue"/>
            <lineMode width="3"/>
            <lines>
@@ -164,7 +164,7 @@
 </tr>
 <tr>
    <td><illustration width="141" height="90">
-           <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+           <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
            <stroke color="deepskyblue"/>
            <lineMode width="3"/>
            <lines>
@@ -176,7 +176,7 @@
        </illustration>
    </td>
    <td><illustration width="141" height="90">
-           <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+           <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
            <stroke color="deepskyblue"/>
            <lineMode width="3"/>
            <lines>
@@ -188,7 +188,7 @@
        </illustration>
    </td>
             <td><illustration width="141" height="90">
-                     <fsimage file="../sample/replogo.gif" x="0" y="0" width="141" height="90"/>
+                     <image file="[z3c.pdftemplate]/sample/replogo.gif" x="0" y="0" width="141" height="90"/>
                      <stroke color="deepskyblue"/>
                      <lineMode width="3"/>
                      <lines>

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex13.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex13.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex13.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -63,8 +63,8 @@
 		<drawRightString x="195mm" y="22mm">B-1300 Limal</drawRightString>
 		<drawRightString x="195mm" y="18mm">TVA: BE.477.472.701</drawRightString>
 		<drawRightString x="195mm" y="14mm">R.C.N. 95636</drawRightString>
-		<fsimage file="../sample/logo.png" x="90mm" y="15mm"/>
-		<fsimage file="../sample/screenshot.jpg" x="28mm" y="196mm"/>
+		<image file="[z3c.pdftemplate]/sample/logo.png" x="90mm" y="15mm"/>
+		<image file="[z3c.pdftemplate]/sample/screenshot.jpg" x="28mm" y="196mm"/>
 
 		<setFont name="Helvetica" size="14"/>
 		<drawCentredString x="71mm" y="187mm">Un concept efficace</drawCentredString>

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex14.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex14.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/ex14.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -16,7 +16,7 @@
             <drawCentredString x="105mm" y="3.4cm">www.printbox.be - 0477/76.18.56 - printbox.be</drawCentredString>
             <drawCentredString x="105mm" y="2.6cm">Tiny SPRL - rue Joseph Mathieu, 28 - B-1300 Limal - BELGIQUE - info at tiny.be</drawCentredString>
             <drawCentredString x="105mm" y="2.0cm">RCN 95656 - TVA BE477.472.701 - IBAN: BE74 1262 0132 6907 - SWIFT: ARTEBEBB</drawCentredString>
-            <fsimage file="../sample/devis_logo.jpg" x="23mm" y="23cm" />
+            <image file="[z3c.pdftemplate]/sample/devis_logo.jpg" x="23mm" y="23cm" />
 
             <setFont name="Helvetica" size="135"/>
             <fill color="(1,0.9,0.9)"/>

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/micromeshfoto.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/micromeshfoto.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/micromeshfoto.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -15,8 +15,8 @@
 
     <pageTemplate id="main">
       <pageGraphics>
-        <fsimage y="265mm" width="35.5mm" x="167mm" 
-            file="../sample/bopplogo.gif" height="25.6mm"/>
+        <image y="265mm" width="35.5mm" x="167mm" 
+            file="[z3c.pdftemplate]/sample/bopplogo.gif" height="25.6mm"/>
       </pageGraphics>
       <frame x1="15mm" y1="0mm" width="185mm" height="300mm" id="header" />
       <frame x1="15mm" y1="87mm" width="185mm" height="11mm" id="middleline" />
@@ -115,7 +115,8 @@
         <td>Geprueft nach / approved according to</td><td>ISO 9044</td></tr>
     </blockTable>
     <illustration width="183mm" height="144.3mm">
-      <fsimage x="0mm" y="0mm" width="182mm" height="136.5mm" file="../sample/micromeshfoto.bmp" />
+      <image x="0mm" y="0mm" width="182mm" height="136.5mm"
+             file="[z3c.pdftemplate]/sample/micromeshfoto.bmp" />
     </illustration>
     <nextFrame/>
     <blockTable style="middleline" colWidths="55mm, 34mm, 15mm, 40.5mm, 38mm">
@@ -169,10 +170,11 @@
         <td>Pruefer / Inspector: Colner Davor</td>
         <td>
           <illustration width="25mm" height="9.5mm">
-            <fsimage y="-4mm" width="25mm" x="0mm" file="../sample/dcolner.gif" height="9.5mm"/>
+            <image y="-4mm" width="25mm" x="0mm"
+                     file="[z3c.pdftemplate]/sample/dcolner.gif" height="9.5mm"/>
           </illustration>
         </td>
       </tr>
     </blockTable>
   </story>
-</document>
\ No newline at end of file
+</document>

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/micromeshprot.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/micromeshprot.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/micromeshprot.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> 
-<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
-<document filename="rollcard.pdf"> 
-<template pageSize="(210mm, 297mm)" 
-        leftMargin="12mm" 
-        rightMargin="10mm" 
-        topMargin="10mm" 
-        bottomMargin="10mm" 
-        title="Example 5 - templates and pageTemplates" 
-        author="Reportlab Inc (Documentation Team)" 
-        showBoundary="0" 
-        > 
-        <!-- showBoundary means that we will be able to see the   --> 
-        <!-- limits of frames                                     --> 
+<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
+<!DOCTYPE document SYSTEM "rml_1_0.dtd">
+<document filename="rollcard.pdf">
+<template pageSize="(210mm, 297mm)"
+        leftMargin="12mm"
+        rightMargin="10mm"
+        topMargin="10mm"
+        bottomMargin="10mm"
+        title="Example 5 - templates and pageTemplates"
+        author="Reportlab Inc (Documentation Team)"
+        showBoundary="0"
+        >
+        <!-- showBoundary means that we will be able to see the   -->
+        <!-- limits of frames                                     -->
 
     <pageTemplate id="main">
       <pageGraphics>
-        <fsimage y="265mm" width="35.5mm" x="167mm" 
-            file="../sample/bopplogo.gif" height="25.6mm"/>
+        <image y="265mm" width="35.5mm" x="167mm"
+            file="[z3c.pdftemplate]/sample/bopplogo.gif" height="25.6mm"/>
       </pageGraphics>
       <frame x1="15mm" y1="0mm" width="185mm" height="300mm" id="header" />
       <frame x1="15mm" y1="87mm" width="185mm" height="11mm" id="middleline" />
@@ -105,62 +105,122 @@
       </tr>
     </blockTable>
     <illustration width="166.8mm" height="150mm">
-      <chart dheight="59.97mm" joinedLines="1" dangle="0" dy="85.5mm" 
-            height="170" width="473" dx="14.5mm" x="0" y="0" charttype="LinePlot" 
-            strokeColor="black" dwidth="166.8mm">
-        <data dataset="[[(1, 1126.4000000000001), (2, 1127.0999999999999), (3, 1129.5), (4, 1134.0), (5, 1131.7), (6, 1140.2), (7, 1128.9000000000001), (8, 1128.9000000000001), (9, 1125.5), (10, 1124.7)], [(1, 1133.4000000000001), (2, 1116.7), (3, 1111.9000000000001), (4, 1118.9000000000001), (5, 1126.5), (6, 1120.9000000000001), (7, 1114.0), (8, 1139.5999999999999), (9, 1145.0), (10, 1146.5999999999999)]]"/>
+      <linePlot
+            dx="14.5mm" dy="85.5mm" dheight="59.97mm" dwidth="166.8mm"
+            x="0" y="0" width="473" height="170"
+            joinedLines="1" dangle="0" strokeColor="black">
+        <data>
+          <series>
+             1 1126.4
+             2 1127.1
+             3 1129.5
+             4 1134.0
+             5 1131.7
+             6 1140.2
+             7 1128.9
+             8 1128.9
+             9 1125.5
+            10 1124.7
+          </series>
+          <series>
+             1 1133.4
+             2 1116.7
+             3 1111.9
+             4 1118.9
+             5 1126.5
+             6 1120.9
+             7 1114.0
+             8 1139.6
+             9 1145.0
+            10 1146.6
+          </series>
+        </data>
         <texts>
-          <text textAnchor="start" fontName="Helvetica" angle="-90" fontSize="10" 
-                fillColor="black" y="-1.5cm" x="-5.4cm" desc="Maschenweite / Aperture [um]"/>
-          <text textAnchor="start" fontName="Helvetica" angle="0" fontSize="10" 
-                fillColor="black" y="-0.9cm" x="4.7cm" desc="Anzahl Messungen / Number of measurements"/>
+          <text textAnchor="start" fontName="Helvetica" fontSize="10"
+                fillColor="black" y="-1.5cm" x="-5.4cm" angle="-90" >
+            Maschenweite / Aperture [um]
+          </text>
+          <text textAnchor="start" fontName="Helvetica" angle="0" fontSize="10"
+                fillColor="black" y="-0.9cm" x="4.7cm">
+            Anzahl Messungen / Number of measurements
+          </text>
         </texts>
         <lines strokeWidth="0.5">
           <line strokeColor="red" symbol="Circle"/>
           <line strokeColor="blue" symbol="Square"/>
         </lines>
-        <xValueAxis valueMin="1" strokeWidth="0.4" labelTextFormat="%2.0f" 
-            gridStrokeWidth="15" gridStrokeDashArray="[1,5]" gridStart="0" 
-            tickUp="170" valueStep="1" visibleGrid="0" gridStrokeColor="red" 
+        <xValueAxis valueMin="1" strokeWidth="0.4" labelTextFormat="%2.0f"
+            gridStrokeWidth="15" gridStrokeDashArray="1 5" gridStart="0"
+            tickUp="170" valueStep="1" visibleGrid="0" gridStrokeColor="red"
             tickDown="0" strokeColor="black" gridEnd="10" valueMax="10">
             <labels fontName="Helvetica"/>
         </xValueAxis>
-        <yValueAxis valueMin="1042.5" strokeWidth="0.4" tickRight="473" 
-            tickLeft="0" gridStrokeDashArray="[1,5]" gridStart="100" 
-            gridStrokeColor="green" valueStep="20" labelTextFormat="%2.0f" 
-            visibleGrid="0" gridStrokeWidth="5" strokeColor="black" 
+        <yValueAxis valueMin="1042.5" strokeWidth="0.4" tickRight="473"
+            tickLeft="0" gridStrokeDashArray="1 5" gridStart="100"
+            gridStrokeColor="green" valueStep="20" labelTextFormat="%2.0f"
+            visibleGrid="0" gridStrokeWidth="5" strokeColor="black"
             gridEnd="0" valueMax="1216">
           <labels fontName="Helvetica"/>
         </yValueAxis>
-      </chart>
+      </linePlot>
       <rotate degrees="0"/>
-      <chart dheight="59.97mm" joinedLines="1" dangle="0" dy="11.5mm" height="170" 
-            width="473" dx="14.5mm" x="0" y="0" charttype="LinePlot" strokeColor="black" 
-            dwidth="166.8mm">
-        <data dataset="[[(1, 16.300000000000001), (2, 16.300000000000001), (3, 16.300000000000001), (4, 16.199999999999999), (5, 16.199999999999999), (6, 16.199999999999999), (7, 16.300000000000001), (8, 16.300000000000001), (9, 16.300000000000001), (10, 16.300000000000001)], [(1, 16.199999999999999), (2, 16.300000000000001), (3, 16.300000000000001), (4, 16.300000000000001), (5, 16.199999999999999), (6, 16.199999999999999), (7, 16.300000000000001), (8, 16.0), (9, 16.0), (10, 16.0)]]"/>
+      <linePlot
+          dx="14.5mm" dy="11.5mm" dheight="59.97mm" dwidth="166.8mm"
+          x="0" y="0" width="473" height="170"
+          joinedLines="1" dangle="0" strokeColor="black">
+        <data>
+          <series>
+             1 16.3
+             2 16.3
+             3 16.3
+             4 16.2
+             5 16.2
+             6 16.2
+             7 16.3
+             8 16.3
+             9 16.3
+            10 16.3
+          </series>
+          <series>
+             1 16.2
+             2 16.3
+             3 16.3
+             4 16.3
+             5 16.2
+             6 16.2
+             7 16.3
+             8 16.0
+             9 16.0
+            10 16.0
+          </series>
+        </data>
         <texts>
-          <text textAnchor="start" fontName="Helvetica" angle="-90" y="-1.5cm" 
-                x="-3.5cm" desc="Mesh" textColor="black" size="10"/>
-          <text textAnchor="start" fontName="Helvetica" angle="0" y="-0.9cm" 
-                x="4.7cm" desc="Anzahl Messungen / Number of measurements" 
-                textColor="black" size="10"/></texts>
-          <lines strokeWidth="0.5">
-            <line strokeColor="red" symbol="Circle"/>
-            <line strokeColor="blue" symbol="Square"/>
-          </lines>
-        <xValueAxis valueMin="1" strokeWidth="0.4" labelTextFormat="%2.0f" 
-            gridStrokeWidth="15" gridStrokeDashArray="[1,5]" gridStart="0" 
-            tickUp="170" valueStep="1" visibleGrid="0" gridStrokeColor="red" 
+          <text textAnchor="start" fontName="Helvetica" angle="-90" y="-1.5cm"
+                x="-3.5cm" textColor="black" size="10">
+            Mesh
+          </text>
+          <text textAnchor="start" fontName="Helvetica" angle="0" y="-0.9cm"
+                x="4.7cm" textColor="black" size="10">
+            Anzahl Messungen / Number of measurements
+          </text>
+        </texts>
+        <lines strokeWidth="0.5">
+          <line strokeColor="red" symbol="Circle"/>
+          <line strokeColor="blue" symbol="Square"/>
+        </lines>
+        <xValueAxis valueMin="1" strokeWidth="0.4" labelTextFormat="%2.0f"
+            gridStrokeWidth="15" gridStrokeDashArray="1 5" gridStart="0"
+            tickUp="170" valueStep="1" visibleGrid="0" gridStrokeColor="red"
             tickDown="0" strokeColor="black" gridEnd="10" valueMax="10">
           <labels fontName="Helvetica"/>
         </xValueAxis>
-        <yValueAxis valueMin="6" strokeWidth="0.4" tickRight="473" tickLeft="0" 
-            gridStrokeDashArray="[1,5]" gridStart="100" gridStrokeColor="green" 
-            valueStep="5" labelTextFormat="%2.0f" visibleGrid="0" gridStrokeWidth="5" 
+        <yValueAxis valueMin="6" strokeWidth="0.4" tickRight="473" tickLeft="0"
+            gridStrokeDashArray="1 5" gridStart="100" gridStrokeColor="green"
+            valueStep="5" labelTextFormat="%2.0f" visibleGrid="0" gridStrokeWidth="5"
             strokeColor="black" gridEnd="0" valueMax="26.3">
           <labels fontName="Helvetica"/>
         </yValueAxis>
-      </chart>
+      </linePlot>
     </illustration>
     <nextFrame/>
     <blockTable style="middleline" colWidths="55mm, 34mm, 15mm, 40.5mm, 38mm">
@@ -168,31 +228,64 @@
     </blockTable>
     <nextFrame/>
     <illustration width="81.13mm" height="56.44mm">
-      <chart dheight="56.44mm" dangle="0" height="160" width="230" dx="14.0mm" 
-            x="0" y="0" charttype="VerticalBarChart" dy="-7.1mm" dwidth="81.13mm">
-        <data dataset="[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.3999999999999999, 9.0, 25.5, 30.0, 18.0, 7.7999999999999998, 0.0, 2.1000000000000001, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 2.3999999999999999, 3.7999999999999998, 5.7000000000000002, 7.0999999999999996, 10.6, 12.1, 14.699999999999999, 11.800000000000001, 6.0999999999999996, 8.5, 3.5, 4.0, 0.0, 0.0, 0.0]]"/>
+      <barChart
+          dx="14.0mm" dy="-7.1mm" dwidth="81.13mm" dheight="56.44mm"
+          x="0" y="0" width="230" height="160" dangle="0" direction="vertical">
+        <data>
+          <series>
+            0.0 0.0 0.0 0.0 0.0 0.0 2.4 9.0 25.5 30.0 18.0 7.8
+            0.0 2.1 0.0 0.0 0.0 0.0
+          </series>
+          <series>
+            0.0 0.0 0.0 2.4 3.8 5.7 7.1 10.6 12.1 14.7 11.8 6.1
+            8.5 3.5 4.0 0.0 0.0 0.0
+          </series>
+        </data>
         <texts>
-          <text textAnchor="start" fontName="Helvetica-Bold" angle="0" y="5.9cm" 
-                x="0cm" desc="Haeufigkeitsverteilung / Histogramm" 
-                textColor="black" size="10"/>
-          <text textAnchor="start" fontName="Helvetica" angle="-90" y="-1.45cm" 
-                x="-5.8cm" desc="Anz. Maschen / No. of apertures in [%]" 
-                textColor="black" size="10"/>
-          <text textAnchor="start" fontName="Helvetica" angle="0" y="-1.3cm" 
-                x="1.7cm" desc="Maschenweite / Aperture [um]" textColor="black" size="10"/>
+          <text textAnchor="start" fontName="Helvetica-Bold" angle="0" y="5.9cm"
+                x="0cm" textColor="black" size="10">
+            Haeufigkeitsverteilung / Histogramm
+          </text>
+          <text textAnchor="start" fontName="Helvetica" angle="-90" y="-1.45cm"
+                x="-5.8cm" textColor="black" size="10">
+            Anz. Maschen / No. of apertures in [%]
+          </text>
+          <text textAnchor="start" fontName="Helvetica" angle="0" y="-1.3cm"
+                x="1.7cm" textColor="black" size="10">
+            Maschenweite / Aperture [um]
+          </text>
         </texts>
         <bars strokeWidth="0.5">
           <bar fillColor="red"/>
           <bar fillColor="blue"/>
         </bars>
-        <valueAxis tickLeft="0" strokeColor="black" strokeWidth="1" visibleGrid="1" 
+        <valueAxis tickLeft="0" strokeColor="black" strokeWidth="1" visibleGrid="1"
             gridStrokeColor="black"><labels fontName="Helvetica"/>
         </valueAxis>
-        <categoryAxis strokeColor="black" strokeWidth="1" 
-            categoryNames="['1040', '1050', '1060', '1070', '1080', '1090', '1100', '1110', '1120', '1130', '1140', '1150', '1160', '1170', '1180', '1190', '1200', '1210']">
-          <labels fontName="Helvetica" angle="90" dx="-5" dy="-12"/>
+        <categoryAxis strokeColor="black" strokeWidth="1">
+          <categoryNames>
+            <name>1040</name>
+            <name>1050</name>
+            <name>1060</name>
+            <name>1070</name>
+            <name>1080</name>
+            <name>1090</name>
+            <name>1100</name>
+            <name>1110</name>
+            <name>1120</name>
+            <name>1130</name>
+            <name>1140</name>
+            <name>1150</name>
+            <name>1160</name>
+            <name>1170</name>
+            <name>1180</name>
+            <name>1190</name>
+            <name>1200</name>
+            <name>1210</name>
+          </categoryNames>
+          <labels fontName="Helvetica" angle="90" dx="-5" dy="-12" />
         </categoryAxis>
-      </chart>
+      </barChart>
     </illustration>
     <nextFrame/>
     <blockTable style="measuresummary" colWidths="7mm, 60mm, 12mm">
@@ -201,7 +294,7 @@
       <tr>
         <td>
           <illustration width="10" height="10">
-            <fsimage y="0" width="10" x="0" file="../sample/dot_red.gif" height="10"/>
+            <image y="0" width="10" x="0" file="[z3c.pdftemplate]/sample/dot_red.gif" height="10"/>
           </illustration>
         </td>
         <td>Kette / Warp</td><td>1129.7</td>
@@ -209,7 +302,7 @@
       <tr>
         <td>
           <illustration width="10" height="10">
-            <fsimage y="0" width="10" x="0" file="../sample/dot_blue.gif" height="10"/>
+            <image y="0" width="10" x="0" file="[z3c.pdftemplate]/sample/dot_blue.gif" height="10"/>
           </illustration>
         </td>
         <td>Schuss / Weft</td><td>1127.3</td></tr><tr><td>Mesh</td><td/><td/>
@@ -217,7 +310,7 @@
       <tr>
         <td>
           <illustration width="10" height="10">
-            <fsimage y="0" width="10" x="0" file="../sample/dot_red.gif" height="10"/>
+            <image y="0" width="10" x="0" file="[z3c.pdftemplate]/sample/dot_red.gif" height="10"/>
           </illustration>
         </td>
         <td>Kette / Warp</td><td>16.3</td>
@@ -225,7 +318,7 @@
       <tr>
         <td>
           <illustration width="10" height="10">
-            <fsimage y="0" width="10" x="0" file="../sample/dot_blue.gif" height="10"/>
+            <image y="0" width="10" x="0" file="[z3c.pdftemplate]/sample/dot_blue.gif" height="10"/>
           </illustration>
         </td>
         <td>Schuss / Weft</td><td>16.2</td>
@@ -241,10 +334,10 @@
         <td>Pruefer / Inspector: Colner Davor</td>
         <td>
           <illustration width="25mm" height="9.5mm">
-            <fsimage y="-4mm" width="25mm" x="0mm" file="../sample/dcolner.gif" height="9.5mm"/>
+            <image y="-4mm" width="25mm" x="0mm" file="[z3c.pdftemplate]/sample/dcolner.gif" height="9.5mm"/>
           </illustration>
         </td>
       </tr>
     </blockTable>
   </story>
-</document>
\ No newline at end of file
+</document>

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/pml_contents.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/pml_contents.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/pml_contents.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-15"?>
-<document 
-    xmlns:tal="http://xml.zope.org/namespaces/tal"
-    xmlns:metal="http://xml.zope.org/namespaces/metal"
-    filename="contents.pdf">
-<content>
-
-<para style="FolderName">
-  Folder Name:
-  <tal:block 
-     condition="context/__name__"
-     replace="context/__name__|default" />
-  <tal:block condition="not:context/__name__">&lt;no name&gt;</tal:block>
-</para>
-
-<spacer height="30" />
-
-<table splitbyrow="1" repeatrows="0" repeatcols="0" style="ContentTable">
-  <tr>
-    <td>Name</td>
-    <td>Title</td>
-    <td>Size</td>
-    <td>Created</td>
-    <td>Modified</td>
-  </tr>
-  <tr tal:repeat="item view/listContentInfo">
-    <td tal:content="item/id">me.png</td>
-    <td tal:content="item/title|default">&lt;no title&gt;</td>
-    <td tal:content="item/size/sizeForDisplay|nothing">34.5 kB</td>
-    <td tal:content="item/created|default"></td>
-    <td tal:content="item/modified|default"></td>
-  </tr>
-</table>
-
-<action name="frameEnd" />
-
-</content>
-</document>

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/pml_template.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/pml_template.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/pml_template.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<template 
-    filename="contents.pdf"
-    pagesize="A4" 
-    landscape="0" 
-    showboundary="0"
-    leftmargin="1cm"
-    rightmargin="1cm"
-    topmargin="1cm"
-    bottommargin="1cm"
-    allowsplitting="1">
-
-  <stylesheet>
-
-   <paragraphstyle 
-       name="Base" 
-       fontName="Helvetica" 
-       fontSize="10" 
-       align="LEFT" 
-       firstLineIndent="0cm" 
-       leftIndent="0.5cm" 
-       rightIndent="0cm" 
-       spaceBefore="0" 
-       spaceAfter="0" 
-       leading="0.5cm" 
-       bulletFontName="Helvetica" 
-       bulletIndent="0cm" 
-       bulletFontSize="10" />
-
-   <paragraphstyle 
-       name="FolderName" 
-       parent="Base" 
-       leftIndent="0cm" 
-       fontName="Helvetica-Bold" 
-       fontSize="16" 
-       leading="0.5cm"
-       spaceBefore="4"
-       spaceAfter="4" />
-
-   <tablestyle name="ContentTable">
-     <stylecmd expr="('LEFTPADDING', (0,0), (-1,-1), 5)"/>
-     <stylecmd expr="('RIGHTPADDING', (0,0), (-1,-1), 5)"/>
-     <stylecmd expr="('TOPPADDING', (0,0), (-1,-1), 3)"/>
-     <stylecmd expr="('BOTTOMPADDING', (0,0), (-1,-1), 7)"/>
-     <stylecmd expr="('ALIGN', (0,0), (-1,-1), 'LEFT')"/>
-     <stylecmd expr="('GRID', (0,0), (-1,-1), 0.5, colors.black)"/>
-     <stylecmd expr="('BOX', (0,0), (-1,-1), 1, colors.black)"/>
-     <stylecmd expr="('FONT', (1,1), (-1,-1), 'Helvetica', 10)"/>
-     <stylecmd expr="('FONT', (0,0), (-1,0), 'Helvetica-Bold', 10)"/>
-     <stylecmd expr="('FONT', (0,1), (0,-1), 'Courier', 10)"/>
-   </tablestyle>
-
-  </stylesheet>
-
-
-  <pagetemplate id="Page" >
-    <static>
-      <infostring 
-          align="left" 
-          x="5cm" 
-          y="28cm" 
-          size="10"
-	  font="Helvetica" 
-          color="(0, 0, 0)">
-        The development of the PDF Template Code was sposored by Projekt01.
-      </infostring>
-    </static>	   
-
-    <frame 
-        id="content"
-   	nextid="content"
-    	x="2cm" 
-        y="1.5cm" 
-	width="17cm" 
-	height="25.5cm" 
-	leftpadding="0.1cm"
-	rightpadding="0.1cm"
-	toppadding="0.5cm"
-	bottompadding="0.5cm"
-	showBoundary="0" />
-  </pagetemplate>
-
-</template>

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/raylprot.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/raylprot.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/raylprot.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -15,8 +15,8 @@
 
     <pageTemplate id="main">
       <pageGraphics>
-        <fsimage y="265mm" width="35.5mm" x="167mm" 
-            file="../sample/bopplogo.gif" height="25.6mm"/>
+        <image y="265mm" width="35.5mm" x="167mm" 
+            file="[z3c.pdftemplate]/sample/bopplogo.gif" height="25.6mm"/>
       </pageGraphics>
       <frame x1="15mm" y1="0mm" width="185mm" height="300mm" id="header" />
       <frame x1="15mm" y1="87mm" width="185mm" height="11mm" id="middleline" />
@@ -195,10 +195,10 @@
         <td>Pruefer / Inspector: Colner Davor</td>
         <td>
           <illustration width="25mm" height="9.5mm">
-            <fsimage y="-4mm" width="25mm" x="0mm" file="../sample/dcolner.gif" height="9.5mm"/>
+            <image y="-4mm" width="25mm" x="0mm" file="[z3c.pdftemplate]/sample/dcolner.gif" height="9.5mm"/>
           </illustration>
         </td>
       </tr>
     </blockTable>
   </story>
-</document>
\ No newline at end of file
+</document>

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rest.txt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rest.txt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rest.txt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,10 +0,0 @@
-=========
-REST demo
-=========
-
-This is a rest demo use in the README.txt file.
-
-Subtitle
---------
-
-This is a subtitle.

Deleted: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rest_template.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rest_template.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rest_template.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,372 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<template 
-    xmlns:tal="http://xml.zope.org/namespaces/tal"
-    filename="default.pdf"
-    pagesize="A4" 
-    landscape="0" 
-    showboundary="0"
-    leftmargin="1cm"
-    rightmargin="1cm"
-    topmargin="1cm"
-    bottommargin="1cm"
-    allowsplitting="1">
-
-  <stylesheet>
-
-   <paragraphstyle 
-       name="Base" 
-       fontName="Helvetica" 
-       fontSize="10" 
-       align="LEFT" 
-       firstLineIndent="0cm" 
-       leftIndent="0.5cm" 
-       rightIndent="0cm" 
-       spaceBefore="0" 
-       spaceAfter="0" 
-       leading="0.5cm" 
-       bulletFontName="Helvetica" 
-       bulletIndent="0cm" 
-       bulletFontSize="10"
-       />
-
-   <paragraphstyle 
-       name="Normal" 
-       fontName="Helvetica" 
-       fontSize="10" 
-       leading="0.5cm"
-       />
-
-   <paragraphstyle 
-       name="DocInfo" 
-       parent="Base" 
-       spaceBefore="4" 
-       spaceAfter="4" 
-       leading="12" 
-       />
-
-   <paragraphstyle 
-       name="Comment" 
-       parent="Base" 
-       fontName="Helvetica-Italic" 
-       />
-
-   <paragraphstyle 
-       name="Indent1" 
-       parent="Base" 
-       leftIndent="36" 
-       firstLineIndent="0" 
-       />
-
-   <paragraphstyle 
-       name="BodyText" 
-       parent="Normal" 
-       spaceBefore="6" 
-       />
-
-   <paragraphstyle 
-       name="Italic" 
-       parent="BodyText" 
-       fontName="Helvetica-Italic" 
-       />
-
-   <paragraphstyle 
-       name="Heading" 
-       parent="Base" 
-       leftIndent="0cm" 
-       fontName="Helvetica-Bold" 
-       fontSize="16" 
-       leading="0.5cm"
-       spaceBefore="4"
-       spaceAfter="4" 
-       />
-
-   <paragraphstyle 
-       name="Heading1" 
-       parent="Heading"
-       leftIndent="0cm" 
-       fontName="Helvetica-Bold" 
-       fontSize="16"
-       leading="0.5cm" 
-       spaceBefore="4" 
-       spaceAfter="8" 
-       />
-
-   <!-- Alias 'h1' for 'Heading1' used by ReST Writer -->
-   <paragraphstyle 
-       name="h1" 
-       parent="Heading1"
-       />
-   
-   <paragraphstyle 
-       name="Heading2" 
-       parent="Base" 
-       leftIndent="0cm" 
-       fontName="Helvetica-Bold" 
-       fontSize="13" 
-       leading="0.5cm" 
-       spaceBefore="4"
-       spaceAfter="4"
-       />
-
-   <!-- Alias 'h2' for 'Heading2' used by ReST Writer -->
-   <paragraphstyle 
-       name="h2" 
-       parent="Heading2"
-       />
-
-   <paragraphstyle 
-       name="Heading3" 
-       parent="Base" 
-       leftIndent="0cm" 
-       fontName="Helvetica-BoldOblique" 
-       fontSize="12" 
-       leading="0.3cm" 
-       spaceBefore="4" 
-       spaceAfter="4"
-       />
-
-   <!-- Alias 'h3' for 'Heading3' used by ReST Writer -->
-   <paragraphstyle 
-       name="h3" 
-       parent="Heading3"
-       />
-
-   <paragraphstyle 
-       name="Heading4" 
-       parent="Base" 
-       leftIndent="0cm" 
-       fontName="Helvetica-BoldOblique" 
-       fontSize="10" 
-       leading="0.3cm" 
-       spaceBefore="4" 
-       spaceAfter="4" 
-       />
-
-   <!-- Alias 'h4' for 'Heading4' used by ReST Writer -->
-   <paragraphstyle 
-       name="h4" 
-       parent="Heading4"
-       />
-
-   <paragraphstyle 
-       name="Heading5" 
-       parent="Base" 
-       leftIndent="0cm" 
-       fontName="Helvetica-Bold" 
-       fontSize="10" 
-       leading="0.3cm" 
-       spaceBefore="4" 
-       spaceAfter="4" 
-       />
-
-   <!-- Alias 'h5' for 'Heading5' used by ReST Writer -->
-   <paragraphstyle 
-       name="h5" 
-       parent="Heading5"
-       />
-
-   <paragraphstyle 
-       name="Heading6" 
-       parent="Base" 
-       leftIndent="0cm" 
-       fontName="Helvetica-Bold" 
-       fontSize="8" 
-       leading="0.3cm" 
-       spaceBefore="4" 
-       spaceAfter="4" 
-       />
-
-   <!-- Alias 'h6' for 'Heading6' used by ReST Writer -->
-   <paragraphstyle 
-       name="h6" 
-       parent="Heading6"
-       />
-
-   <paragraphstyle 
-       name="Title"
-       parent="Heading" 
-       fontSize="22" 
-       spaceAfter="1.5cm"
-       alignment="center" 
-       />
-
-   <!-- Alias 'title' for 'Title' used by ReST Writer -->
-   <paragraphstyle 
-       name="title" 
-       parent="Title"
-       />
-
-   <paragraphstyle 
-       name="Subtitle"
-       parent="Heading" 
-       fontSize="20" 
-       spaceAfter="1.5cm"
-       alignment="center" 
-       />
-
-   <!-- Alias 'subtitle' for 'Subtitle' used by ReST Writer -->
-   <paragraphstyle 
-       name="subtitle" 
-       parent="Subtitle"
-       />
-
-   <paragraphstyle 
-       name="TopicTitle"
-       parent="Heading" 
-       fontSize="18" 
-       leading="14"
-       spaceAfter="6"
-       />
-
-   <!-- Alias 'topic-title' for 'TopicTitle' used by ReST Writer -->
-   <paragraphstyle 
-       name="topic-title" 
-       parent="TopicTitle"
-       />
-
-   <tal:block repeat="i python: range(15)">
-
-   <paragraphstyle 
-       name="TopicItem"
-       parent="Normal" 
-       fontSize="12" 
-       leftIndent="0"
-       spaceBefore="0"
-       spaceAfter="0"
-       tal:attributes="
-           name string:TopicItem$i;
-           leftIndent python:18*i"
-       />
-
-   <!-- Alias used by ReST Writer -->
-   <paragraphstyle 
-       name="topic-item" 
-       parent="TopicItems"
-       tal:attributes="
-           name string:topic-item-$i;       
-           parent string:TopicItem$i;"
-       />
-
-   </tal:block>
-
-   <paragraphstyle 
-       name="UnorderedList" 
-       parent="Normal"
-       firstLineIndent="0" 
-       leftIndent="18"
-       spaceBefore="0"
-       bulletFontName="Symbol"
-       bulletIndent="9"
-       />
-
-   <!-- Alias 'ul' for 'UnorderedList' used by ReST Writer -->
-   <paragraphstyle 
-       name="ul" 
-       parent="UnorderedList"
-       />
-
-   <paragraphstyle 
-       name="Definition"
-       parent="Normal"
-       firstLineIndent="0" 
-       leftIndent="36"
-       spaceBefore="2"
-       spaceAfter="2"
-       bulletFontName="Helvetica-BoldOblique"
-       bulletIndent="0"
-       />
-
-   <!-- Alias 'dl' for 'Definition' used by ReST Writer -->
-   <paragraphstyle 
-       name="dl" 
-       parent="Definition"
-       />
-
-   <paragraphstyle 
-       name="OrderedList" 
-       parent="Definition"
-       />
-
-   <!-- Alias 'ol' for 'OrderedList' used by ReST Writer -->
-   <paragraphstyle 
-       name="ol" 
-       parent="OrderedList"
-       />
-
-   <paragraphstyle 
-       name="Code" 
-       parent="Normal"
-       fontName="Courier"
-       textColor="navy"
-       leading="8.8"
-       leftIndent="36"
-       firstLineIndent="0"
-       spaceBefore="5"
-       spaceAfter="10"
-       />
-
-   <paragraphstyle 
-       name="FunctionHeader"
-       parent="Normal"
-       fontName="Courier-Bold"
-       fontSize="8"
-       leading="8.8"
-       />
-
-   <paragraphstyle 
-       name="DocString"
-       parent="Normal"
-       fontName="Courier"
-       fontSize="8"
-       leftIndent="18"
-       leading="8.8"
-       />
-
-   <paragraphstyle 
-       name="DocStringIndent"
-       parent="Normal"
-       fontName="Courier"
-       fontSize="8"
-       leftIndent="36"
-       leading="8.8"
-       />
-
-   <paragraphstyle
-       name="URL" 
-       parent="Normal"
-       fontName="Courier"
-       textColor="navy"
-       alignment="center"
-       />
-
-   <paragraphstyle
-       name="Centered" 
-       parent="Normal"
-       alignment="center"
-       />
-
-   <paragraphstyle
-       name="Caption"
-       parent="Centered"
-       fontName="Helvetica-Italic"
-       />
-
-  </stylesheet>
-
-  <pagetemplate id="Page" >
-    <frame 
-        id="content"
-   	nextid="content"
-    	x="2cm" 
-        y="1.5cm" 
-	width="17cm" 
-	height="25.5cm" 
-	leftpadding="0.1cm"
-	rightpadding="0.1cm"
-	toppadding="0.5cm"
-	bottompadding="0.5cm"
-	showBoundary="0" 
-        />
-  </pagetemplate>
-
-</template>

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rollcard.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rollcard.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/rollcard.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> 
-<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
-<document filename="rollcard.pdf"> 
-<template pageSize="(210mm, 297mm)" 
-        leftMargin="12mm" 
-        rightMargin="10mm" 
-        topMargin="10mm" 
-        bottomMargin="10mm" 
-        title="Example 5 - templates and pageTemplates" 
-        author="Reportlab Inc (Documentation Team)" 
-        showBoundary="0" 
-        > 
-        <!-- showBoundary means that we will be able to see the   --> 
-        <!-- limits of frames                                     --> 
+<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
+<!DOCTYPE document SYSTEM "rml_1_0.dtd">
+<document filename="rollcard.pdf">
+<template pageSize="(210mm, 297mm)"
+        leftMargin="12mm"
+        rightMargin="10mm"
+        topMargin="10mm"
+        bottomMargin="10mm"
+        title="Example 5 - templates and pageTemplates"
+        author="Reportlab Inc (Documentation Team)"
+        showBoundary="0"
+        >
+        <!-- showBoundary means that we will be able to see the   -->
+        <!-- limits of frames                                     -->
 
     <pageTemplate id="main">
       <frame x1="12mm" y1="0mm" width="190mm" height="300mm" id="text" />
@@ -68,8 +68,8 @@
         <lineStyle start="0,8" kind="LINEBELOW" stop="5,-1" colorName="black"/>
         <blockBottomPadding start="0,10" length="30mm" stop="-1,10"/>
     </blockTableStyle>
-    <paraStyle name="psmall" 
-      fontName="Helvetica" 
+    <paraStyle name="psmall"
+      fontName="Helvetica"
       fontSize="6"
       alignment="center" />
     <blockTableStyle id="footer">
@@ -312,7 +312,6 @@
       </tr>
     </blockTable>
 
-
     <blockTable style="matquality" colWidths="38.5mm, 10.5mm, 10.5mm, 10.5mm, 10.5mm, 10.5mm, 87mm">
       <tr>
 	<td>Qualitaets-Vermerke</td>
@@ -327,90 +326,90 @@
 	<td>Sauberkeit</td>
 	<td>
           <para style="psmall">sauber</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">leicht-schmutzig</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">schmutzig</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
-	</td>	
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	</td>
 	<td/>
       </tr>
       <tr>
 	<td>Webfehler</td>
 	<td>
           <para style="psmall">wenig-od.-keine</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">einige</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">viele</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
-	</td>	
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	</td>
 	<td/>
       </tr>
       <tr>
 	<td>Gewebe-Bindung</td>
 	<td>
           <para style="psmall">gut</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">mittel</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">lose</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
-	</td>	
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	</td>
 	<td/>
       </tr>
       <tr>
 	<td>Planlage</td>
 	<td>
           <para style="psmall">sauber</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">leicht-schmutzig</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">schmutzig</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
-	</td>	
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	</td>
 	<td/>
       </tr>
       <tr>
 	<td>Farbe</td>
 	<td>
           <para style="psmall">hell</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">dunkel</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">unregelm.</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
-	</td>	
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	</td>
 	<td/>
       </tr>
       <tr>
@@ -420,40 +419,41 @@
 	<td/>
 	<td/>
 	<td/>
-      </tr>      
+	<td/>
+      </tr>
       <tr>
 	<td>   Schuss</td>
 	<td>
           <para style="psmall">gut</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">streifig</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">gassig</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
-	</td>	
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	</td>
 	<td/>
-      </tr>      
+      </tr>
       <tr>
 	<td>   Kette</td>
 	<td>
           <para style="psmall">gut</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">streifig</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
 	<td>
           <para style="psmall">gassig</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
       </tr>
@@ -461,23 +461,23 @@
 	<td>Allgemein</td>
 	<td>
 	  <para style="psmall">gut</para>
-	  <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td>
-	  <para style="psmall">-</para> 
-          <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <para style="psmall">-</para>
+          <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td>
-	  <para style="psmall">mittel</para> 
-          <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <para style="psmall">mittel</para>
+          <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td>
-	  <para style="psmall">-</para> 
-          <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <para style="psmall">-</para>
+          <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td>
-	  <para style="psmall">schlecht</para> 
-          <illustration width="10" height="10"><fsimage file="../sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
+	  <para style="psmall">schlecht</para>
+          <illustration width="10" height="10"><image file="[z3c.pdftemplate]/sample/box.gif" x="0" y="0"  width="10" height="10"/></illustration>
 	</td>
 	<td/>
       </tr>
@@ -491,19 +491,21 @@
 	<td/>
       </tr>
     </blockTable>
+
     <blockTable style="footer" colWidths="91mm, 62mm, 25mm">
       <tr>
         <td>Datum / Date: 05.01.2005</td>
         <td>Pruefer / Inspector: Colner Davor</td>
         <td>
           <illustration width="25mm" height="9.5mm">
-            <fsimage y="-4mm" width="25mm" x="0mm" file="../sample/dcolner.gif" height="9.5mm"/>
+            <image y="-4mm" width="25mm" x="0mm" file="[z3c.pdftemplate]/sample/dcolner.gif" height="9.5mm"/>
           </illustration>
         </td>
       </tr>
     </blockTable>
     <nextFrame />
-    <blockTable style="mirror" colWidths="10mm, 9mm, 10mm, 10mm, 9mm, 10mm, 10mm, 9mm, 10mm">
+    <blockTable style="mirror"
+                colWidths="10mm, 9mm, 10mm, 10mm, 9mm, 10mm, 10mm, 9mm, 10mm">
       <tr><td/><td>1</td><td/><td/><td>21</td><td/><td/><td>41</td><td/></tr>
       <tr><td/><td>2</td><td/><td/><td>22</td><td/><td/><td>42</td><td/></tr>
       <tr><td/><td>3</td><td/><td/><td>23</td><td/><td/><td>43</td><td/></tr>
@@ -528,21 +530,22 @@
     </blockTable>
     <nextFrame />
     <illustration width="90mm" height="216.3mm">
-      <stroke color="black"/> 
-      <fill color="blue"/>  
+      <stroke color="black"/>
+      <fill color="blue"/>
       <setFont name="Helvetica" size="8"/>
 
-      <rect x="0mm" y="0mm" width="10mm" height="10mm" fill="yes" stroke="no"/> 
-      <rect x="0mm" y="214.6mm" width="3mm" height="3mm" fill="yes" stroke="no"/> 
-      <rect x="76.7mm" y="0mm" width="10mm" height="10mm" fill="yes" stroke="no"/> 
-      <rect x="76.7mm" y="207.6mm" width="10mm" height="10mm" fill="yes" stroke="no"/> 
-      <rect x="76.7mm" y="207.6mm" width="10mm" height="10mm" fill="yes" stroke="no"/> 
-      <circle x="5mm" y="210mm" radius="1mm" fill="yes" stroke="no"/> 
+      <rect x="0mm" y="0mm" width="10mm" height="10mm" fill="yes" stroke="no"/>
+      <rect x="0mm" y="214.6mm" width="3mm" height="3mm" fill="yes" stroke="no"/>
+      <rect x="76.7mm" y="0mm" width="10mm" height="10mm" fill="yes" stroke="no"/>
+      <rect x="76.7mm" y="207.6mm" width="10mm" height="10mm" fill="yes" stroke="no"/>
+      <rect x="76.7mm" y="207.6mm" width="10mm" height="10mm" fill="yes" stroke="no"/>
+      <circle x="5mm" y="210mm" radius="1mm" fill="yes" stroke="no"/>
       <drawString x="7mm" y="209mm">DS</drawString>
-      <rect x="0mm" y="200mm" width="29mm" height="0.5mm" fill="yes" stroke="no"/> 
+      <rect x="0mm" y="200mm" width="29mm" height="0.5mm" fill="yes" stroke="no"/>
       <drawString x="26mm" y="201mm">S</drawString>
-      
 
+
     </illustration>
+-->
   </story>
 </document>

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/thicknessprot.pt
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/thicknessprot.pt	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample/thicknessprot.pt	2007-03-14 22:39:24 UTC (rev 73177)
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> 
-<!DOCTYPE document SYSTEM "rml_1_0.dtd"> 
-<document filename="rollcard.pdf"> 
-<template pageSize="(210mm, 297mm)" 
-        leftMargin="12mm" 
-        rightMargin="10mm" 
-        topMargin="10mm" 
-        bottomMargin="10mm" 
-        title="Example 5 - templates and pageTemplates" 
-        author="Reportlab Inc (Documentation Team)" 
-        showBoundary="0" 
-        > 
-        <!-- showBoundary means that we will be able to see the   --> 
-        <!-- limits of frames                                     --> 
+<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
+<!DOCTYPE document SYSTEM "rml_1_0.dtd">
+<document filename="rollcard.pdf">
+<template pageSize="(210mm, 297mm)"
+        leftMargin="12mm"
+        rightMargin="10mm"
+        topMargin="10mm"
+        bottomMargin="10mm"
+        title="Example 5 - templates and pageTemplates"
+        author="Reportlab Inc (Documentation Team)"
+        showBoundary="0"
+        >
+        <!-- showBoundary means that we will be able to see the   -->
+        <!-- limits of frames                                     -->
 
     <pageTemplate id="main">
       <pageGraphics>
-        <fsimage y="265mm" width="35.5mm" x="167mm" 
-            file="../sample/bopplogo.gif" height="25.6mm"/>
+        <image x="167mm" y="265mm" width="35.5mm" height="25.6mm"
+               file="[z3c.pdftemplate]/sample/bopplogo.gif" />
       </pageGraphics>
       <frame x1="15mm" y1="220mm" width="185mm" height="80mm" id="header" />
       <frame x1="15mm" y1="28mm" width="90.2mm" height="210mm" id="summary" />
@@ -138,24 +138,24 @@
       <tr><td>Haeufigkeitsverteilung / Histogramm</td><td></td></tr>
     </blockTable>
     <illustration width="81.13mm" height="56.44mm">
-      <chart dheight="56.44mm" dangle="0" height="160" width="230" dx="14.0mm" 
+      <chart dheight="56.44mm" dangle="0" height="160" width="230" dx="14.0mm"
             x="0" y="0" charttype="VerticalBarChart" dy="-4.1mm" dwidth="81.13mm">
         <data dataset="[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.0, 31.0, 30.0, 30.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]" />
         <texts>
-          <text textAnchor="start" fontName="Helvetica" angle="-90" y="-1.45cm" 
-                x="-2.95cm" desc="[%]" 
+          <text textAnchor="start" fontName="Helvetica" angle="-90" y="-1.45cm"
+                x="-2.95cm" desc="[%]"
                 textColor="black" size="10"/>
-          <text textAnchor="start" fontName="Helvetica" angle="0" y="-1.3cm" 
+          <text textAnchor="start" fontName="Helvetica" angle="0" y="-1.3cm"
                 x="1.0cm" desc="Gewebe Dicke / Mesh Thickness [um]" textColor="black" size="10"/>
         </texts>
         <bars strokeWidth="0.5">
           <bar fillColor="red"/>
           <bar fillColor="blue"/>
         </bars>
-        <valueAxis tickLeft="0" strokeColor="black" strokeWidth="1" visibleGrid="1" 
+        <valueAxis tickLeft="0" strokeColor="black" strokeWidth="1" visibleGrid="1"
             gridStrokeColor="black"><labels fontName="Helvetica"/>
         </valueAxis>
-        <categoryAxis strokeColor="black" strokeWidth="1" 
+        <categoryAxis strokeColor="black" strokeWidth="1"
             categoryNames="['53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71']">
           <labels fontName="Helvetica" angle="90" dx="-5" dy="-12"/>
         </categoryAxis>
@@ -164,7 +164,7 @@
     <blockTable style="measuresummary2" colWidths="73mm, 15mm">
       <tr><td>Bemerkungen / Remarks:</td><td/></tr>
     </blockTable>
-    <nextFrame/>    
+    <nextFrame/>
     <blockTable style="measuredetails" colWidths="12mm, 11mm, 14mm, 14mm">
       <tr><td>Messungen / Measurements [Microns]</td><td/><td/><td/></tr>
       <tr><td>Point</td><td>L </td><td>M </td><td>R </td></tr>
@@ -209,10 +209,10 @@
         <td>Pruefer / Inspector: Colner Davor</td>
         <td>
           <illustration width="25mm" height="9.5mm">
-            <fsimage y="-4mm" width="25mm" x="0mm" file="../sample/dcolner.gif" height="9.5mm"/>
+            <image y="-4mm" width="25mm" x="0mm" file="[z3c.pdftemplate]/sample/dcolner.gif" height="9.5mm"/>
           </illustration>
         </td>
       </tr>
     </blockTable>
   </story>
-</document>
\ No newline at end of file
+</document>

Modified: z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample.zcml
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample.zcml	2007-03-14 22:34:35 UTC (rev 73176)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/sample.zcml	2007-03-14 22:39:24 UTC (rev 73177)
@@ -4,38 +4,12 @@
     zcml:condition="have devmode"
     i18n_domain="zope">
 
-  <!-- examples for reStructed Text to PDF conversion -->
+  <!-- examples for RML to PDF conversion -->
 
-  <browser:rest2pdf
-      name="sample_rest.pdf"
-      path="sample/rest.txt"
-      />
-
-  <browser:rest2pdf
-      name="sample_rest2.pdf"
-      path="sample/rest.txt"
-      template="sample/rest_template.pt"
-      />
-
-
-  <!-- examples for PML to PDF conversion -->
-
-  <browser:pml2pdf
-      name="sample_pml.pdf"
-      for="zope.app.folder.interfaces.IFolder"
-      template="sample/pml_template.pt"
-      document="sample/pml_contents.pt"
-      class="zope.app.container.browser.contents.Contents"
-      permission="zope.Public"
-      />
-
-
-  <!-- examples for tinyRML to PDF conversion -->
-
   <browser:rml2pdf
       name="sample_rml.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/rml_contents.pt"
+      template="sample/rml_contents.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -43,7 +17,7 @@
   <browser:rml2pdf
       name="ex01.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex01.pt"
+      template="sample/ex01.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -51,7 +25,7 @@
   <browser:rml2pdf
       name="ex02.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex02.pt"
+      template="sample/ex02.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -59,7 +33,7 @@
   <browser:rml2pdf
       name="ex03.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex03.pt"
+      template="sample/ex03.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -67,7 +41,7 @@
   <browser:rml2pdf
       name="ex04.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex04.pt"
+      template="sample/ex04.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -75,7 +49,7 @@
   <browser:rml2pdf
       name="ex05.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex05.pt"
+      template="sample/ex05.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -83,7 +57,7 @@
   <browser:rml2pdf
       name="ex06.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex06.pt"
+      template="sample/ex06.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -91,7 +65,7 @@
   <browser:rml2pdf
       name="ex07.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex07.pt"
+      template="sample/ex07.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -99,7 +73,7 @@
   <browser:rml2pdf
       name="ex08.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex07.pt"
+      template="sample/ex07.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -107,7 +81,7 @@
   <browser:rml2pdf
       name="ex09.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex09.pt"
+      template="sample/ex09.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -115,7 +89,7 @@
   <browser:rml2pdf
       name="ex10.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex10.pt"
+      template="sample/ex10.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -123,7 +97,7 @@
   <browser:rml2pdf
       name="ex11.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex11.pt"
+      template="sample/ex11.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -131,7 +105,7 @@
   <browser:rml2pdf
       name="ex12.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex12.pt"
+      template="sample/ex12.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -139,7 +113,7 @@
   <browser:rml2pdf
       name="ex13.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex13.pt"
+      template="sample/ex13.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -147,7 +121,7 @@
   <browser:rml2pdf
       name="ex14.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/ex14.pt"
+      template="sample/ex14.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -155,7 +129,7 @@
   <browser:rml2pdf
       name="rollcard.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/rollcard.pt"
+      template="sample/rollcard.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -163,7 +137,7 @@
   <browser:rml2pdf
       name="micromeshfoto.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/micromeshfoto.pt"
+      template="sample/micromeshfoto.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -171,7 +145,7 @@
   <browser:rml2pdf
       name="micromeshprot.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/micromeshprot.pt"
+      template="sample/micromeshprot.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -179,7 +153,7 @@
   <browser:rml2pdf
       name="raylprot.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/raylprot.pt"
+      template="sample/raylprot.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />
@@ -187,7 +161,7 @@
   <browser:rml2pdf
       name="thicknessprot.pdf"
       for="zope.app.folder.interfaces.IFolder"
-      document="sample/thicknessprot.pt"
+      template="sample/thicknessprot.pt"
       class="zope.app.container.browser.contents.Contents"
       permission="zope.Public"
       />

Copied: z3c.pdftemplate/trunk/src/z3c/pdftemplate/zcml.py (from rev 73157, z3c.pdftemplate/trunk/src/z3c/pdftemplate/metaconfigure.py)
===================================================================
--- z3c.pdftemplate/trunk/src/z3c/pdftemplate/metaconfigure.py	2007-03-13 17:39:28 UTC (rev 73157)
+++ z3c.pdftemplate/trunk/src/z3c/pdftemplate/zcml.py	2007-03-14 22:39:24 UTC (rev 73177)
@@ -0,0 +1,59 @@
+###############################################################################
+#
+# Copyright (c) 2005 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+###############################################################################
+"""Directive Handler for several PDF generating presentation components
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+import os.path
+
+from zope.configuration.exceptions import ConfigurationError
+from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
+from zope.app.publisher.browser.viewmeta import page
+from zope.app.publisher.browser.metadirectives import IPageDirective
+
+from z3c.pdftemplate.rml import RML2PDFView
+
+
+class IRMLToPDFDirective(IPageDirective):
+    """A view directive that dynamically evaluates a RML document and converts
+    it to PDF.
+
+    This directive behaves very much like the ``page`` directive, except that
+    it does not generate HTML, but RML that is rendered to PDF for output. RML
+    is a simple XML-dialect that creates a storyboard for the reportlab PDF
+    rendering engine.
+    """
+
+
+def rml2pdf(_context, name, permission, for_, template,
+            layer=IDefaultBrowserLayer, class_=RML2PDFView,
+            allowed_interface=None, allowed_attributes=None,
+            menu=None, title=None):
+
+    if class_ is not RML2PDFView and RML2PDFView not in class_.__bases__:
+        bases = (class_, RML2PDFView)
+    else:
+        bases = (class_,)
+
+    factory = type(
+        'RML2PDFView from template=%s' %(str(template)),
+        bases,
+        {'template': ViewPageTemplateFile(template)}
+        )
+
+    page(_context, name, permission, for_, layer, None, factory,
+         allowed_interface, allowed_attributes, '__call__', menu, title)



More information about the Checkins mailing list