Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate PDFs directly instead of SVGs #4

Open
timparenti opened this issue Oct 11, 2014 · 3 comments
Open

Generate PDFs directly instead of SVGs #4

timparenti opened this issue Oct 11, 2014 · 3 comments

Comments

@timparenti
Copy link
Member

The additions in c34199f summarize workarounds employed by @catern to convert the output of the SVG generators into PDFs suitable for printing.

We should probably be aiming to generate PDFs directly. Python packages exist to help with this, including pyfpdf and pdfrw, but those don't seem to have been updated in a while.

@haoxuany
Copy link
Contributor

One other option is to generate PostScript files for easier printing, since it has a much simpler format definition than PDFs.
One package I found is PyX. It can generate Extended PostScripts and PDFs. However, it seems to be geared mostly towards latex graph generations. One way to draw the poster is to manually write the draw instructions, which may or may not be what we want.

@timparenti
Copy link
Member Author

Awesome! PostScript would definitely be a suitably reasonable intermediate.

For additional convenience, ghostscript looks like it can handle basic PostScript to PDF conversion; maybe it'd be good enough for our needs.

@timparenti
Copy link
Member Author

I just came across cairosvg, which may actually be able to handle this. It has a fairly comprehensive page about the various features of SVG that it supports, and at a cursory glance it seems to be able to handle most of what we'd need.

I'm having trouble getting it to successfully install via pip, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants