A "ready-made solution" is certainly a good idea: no point in reinventing wheels.
If the "HTMLDOC" you're referring to is HTML::HTMLDoc, I'd advise some caution.
This module has many unresolved bugs and maintainance appears to have been abandoned.
I did some investigation into this a few days ago: "Re: HTML::HTMLDoc -- Including a base64 img".
I'm not familiar with the other two solutions you mentioned.
| [reply] |
No, all three solutions I mentioned are not Perl modules but C/C++ tools. See docfrac.net for Docfrac and try googling the other two tools - unfortunately my access level doesn't allow me to post links here yet.
Used all three of these in my projects (well, PHP projects to be clear but not much difference for this matter), they have some quirks but generally work. wkhtmltopdf is the most advanced one (basicly it's a full-featured WebKit-based browser with PDF exporting option) but it tends to render images instead of text which may be not what you want. Docfrac and HTMLDOC, on the other hand, are HTML parsers/renderers, their output PDF is better structured but support for formatting is very limited.
And, generally speaking, the task of converting HTML to a picture (PNG, JPEG, PDF, etc) falls rather out of Perl's scope - it's not impossible to implement a decent layout engine in Perl but, well, performance would be a disaster and amount of work incredible.
| [reply] |
"No, all three solutions I mentioned are not Perl modules ..."
Fair enough. Ignore my word of caution and thanks for posting the additional information.
"... unfortunately my access level doesn't allow me to post links here yet."
That doesn't sound right at all.
As far as I know, there's no restrictions on posting links: anyone at all can do this (even if you're not logged in, i.e. Anonymous Monk).
The usual way is to use one of the "linking shortcuts".
You can use the HTML '<a>' element (see "Perl Monks Approved HTML tags") if you want.
In case you weren't aware, there are some non-HTML tags you can also use (see "Writeup Formatting Tips").
| [reply] [d/l] |
Damn, I tried a lot of solutions before trying yours since i finally wanted to try a client side solution (i.e. in javascript)
Since the css i am using is kinda simple, i tried half a dozen of solutions.
Clearly for me, wkhtmltopdf is the greatest solution. I wish i had found a way to do this on the client side but at least i get exactly the same output as my html.
Thx for pointing me this out.
Also thx to anyone contributing to the thread :)
cheers | [reply] |