Salut Claude,
On 28.06.07, Claude wrote:
> My document is built as follows :
>
> canevas = canvas.canvas()
> canevas.insert (graph1) #graph1 contains a curve
> canevas.insert (graph2) #graph2 contains a curve
>
> pied_page = text.texrunner()
> pied_page.set(mode="latex")
> pied_page.preamble(r"\usepackage{datetime} \shortdate")
> canevas.insert (pied_page.text(0,0,r"\begin{tabular}{|l|l|} \hline
> \multicolumn{2}{|c|}{texte_line1} \\ \hline \today ~@ \xxivtime & text_line2
> \\
> \hline \multicolumn{2}{|c|}{text_line3} \\ \hline \end{tabular}"))
>
> # Page
> page1 = document.page(canevas,centered=0)
> page2 = document.page(canevas)
>
> # Document
> my_doc = document.document([page1,page2])
>
> Despite the "centered=0", the page1 output has a centered content, as page2.
>
> Moreover, the result is now cut, I miss 0,5 cm on the left side of the page
> and
> 1 cm at its bottom (the printer margins).
> Where is my mistake ?
1. If there is no paperformat specified (and there is no default
format set: this is a bug in the documentation) then nothing can be
centered. I thus cannot believe that either of the two pages is
centered in your example. Note that if you output the whole file as
PDF and look at it with acroread, then acroread displays only the
bounding box, thus it may look centered while it is not.
2. The cutting in the non-centered version might be due to the fact
that the graph has negative coordinates for the lower left point of
its bounding box. There are some programs around which have
problems with that (there was such an issue several times on this
list:
http://www.mail-archive.com/[email protected]/msg00108.html
http://sourceforge.net/mailarchive/message.php?msg_name=200605162202.01065.diederik.huys%40student.kuleuven.be
http://sourceforge.net/mailarchive/forum.php?thread_id=7303626&forum_id=23700
http://sourceforge.net/mailarchive/forum.php?thread_name=Pine.LNX.4.51.0603090853300.10821%40ptpcp8.phy.tu-dresden.de&forum_name=pyx-user
To clarify things, I propose the following minimal example:
from pyx import *
# Canvases
c1, c2 = canvas.canvas(), canvas.canvas()
c1.stroke(path.rect(0, 0, 1, 1))
c2.stroke(path.rect(0, 0, 2, 2))
# Pages
p1 = document.page(c1, centered=0, paperformat=document.paperformat.A4)
p2 = document.page(c2, paperformat=document.paperformat.A4)
# Document
d = document.document([p1, p2])
d.writePSfile("foo")
d.writePDFfile("foo")
This should work (it does for me).
Michael.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user