Hi,
On 30.07.06, Tom Bridgman wrote:
> I've been using PyX for a while now but I haven't figured out how to
> fill in the document properties for PDF files.
>
> I've tried things like
>
> g.writePDFfile(outfile,{'title':"my document",
> 'author':"me",
> 'subject':"my metadata tests",
> 'keywords':"metadata, PDF"})
>
> and the tuple version for *args but nothing seems to make it into the
> PDF.
>
> What am I missing? PDFwriter object seems to have support for this.
Yes, we can add such metadata to a PDF. But you need to understand,
that writePDFfile is just a simple helper to construct very basic,
single page documents. And all additional keyword parameters, which
are passed to writePDFfile, will be used as parameters for the page.
However, you want to set document properties, more precisely some
properties, which are features of the pdfwriter. Here it comes how you
can do that:
from pyx import *
c = canvas.canvas()
c.text(0, 0, "Hello, world!")
c.stroke(path.line(0, 0, 2, 0))
p = document.page(c) # page properties could be set here (like a
paperformat)
d = document.document([p]) # document properties could be set here
d.writePDFfile("hello", title="Hello, world!") # special properties
depending on the writer can be set here
HTH,
André
--
by _ _ _ Dr. André Wobst
/ \ \ / ) [EMAIL PROTECTED], http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user