Skip to content

Commit

Permalink
Merge pull request #85 from Abdur-rahmaanJ/readme-docs
Browse files Browse the repository at this point in the history
docs: README v1
  • Loading branch information
regebro committed Feb 23, 2023
2 parents ff5a194 + e0e451b commit 4065a40
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,62 @@ You can read all about ``z3c.rml`` and see many examples on how to use it,
see the `RML Reference`_

.. _RML Reference: https://github.com/zopefoundation/z3c.rml/blob/master/src/z3c/rml/rml-reference.pdf?raw=true


Install on pip::

pip install z3c.rml

z3c.rml is then available on the commandline as z3c.rml.::

$ z3c.rml --help
usage: rml2pdf [-h]
xmlInputName [outputFileName] [outDir]
[dtdDir]

Converts file in RML format into PDF file.

positional arguments:
xmlInputName RML file to be processed
outputFileName output PDF file name
outDir output directory
dtdDir directory with XML DTD (not yet supported)

optional arguments:
-h, --help show this help message and exit

Copyright (c) 2007 Zope Foundation and Contributors.

Save this file as file.rml::

<!DOCTYPE document SYSTEM "rml.dtd">
<document filename="example_01.pdf">
<template showBoundary="1"> <!--Debugging is now turned on, frame outlines -->
<!--will appear on the page -->
<pageTemplate id="main">
<!-- two frames are defined here: -->
<frame id="first" x1="100" y1="400" width="150" height="200"/>
<frame id="second" x1="300" y1="400" width="150" height="200"/>
</pageTemplate>
</template>
<stylesheet>
<!-- still empty...-->
</stylesheet>
<story>
<para>
Welcome to RML.
</para>
</story>
</document>


Then run::

$ z3c.rml file.rml

The output will be example_01.pdf as defined in the document

Codewise you can do::

from z3c.rml import rml2pdf
rml2pdf.go('file.rml','file.pdf')

0 comments on commit 4065a40

Please sign in to comment.