Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How to create beautiful PDF from Pod

by tobyink (Canon)
on Oct 26, 2012 at 13:53 UTC ( [id://1001084]=note: print w/replies, xml ) Need Help??


in reply to How to create beautiful PDF from Pod

I'd go with your current solution, but swap out Opera in favour of the Python xhtml2pdf library. No, you don't need to learn Python; it's bundled with a command-line script.

Or instead of xhtml2pdf, wkhtmltopdf.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: How to create beautiful PDF from Pod
by Tux (Canon) on Oct 28, 2012 at 14:50 UTC

    The pyhton stuff installed but failed due to missing dependency. I didn't want to pursue that.

    The wkhtmltopdf solution works quite well. The perl module around it sucks, as it does not offer any features beyond the program itself. I would have hoped for it to support streaming (piped input, piped output), but all it does is pass the arguments to the system command. I can do that myself.

    Pod::Html shows its age. Not well thought through, sadly. Even if one uses local *STDOUT;, there is no way to get its output caught. This module also doe not support piping/streaming.

    I ended up with the code below (feel free to use, alter or comment on), where I still note a few drawbacks …

    • Page wraps are unclean. On many page breaks the top half of a line is on the end of one page, the bottom half is on the next
    • CSS like text-align: justify; doesn't work very well.

    Enjoy, Have FUN! H.Merijn
      Zombie potyl's work with HTML → Webkit → Cairo → PDF is super-sweet: CPAN, Github. There's lots of example code strewn around, check every distro/repository that looks related/has the keywords in the name.

      As of 2012, this is the most modern and formidable solution.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1001084]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-19 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found