What is the best Perl module to use for creating a .pdf from scratch?

强颜欢笑 提交于 2019-11-28 17:59:17

I'm the author of the CPAN module CAM::PDF which is definitely not the best tool for this job -- it's designed for high-performance editing, not creating.

Among free PDF creation libraries, I like PDF::API2 the best. It has a very rich feature set and good encryption support (inspired by CAM::PDF I might add!) The author, Alfredo, manages a popular email list. People sometimes complain about documentation, but I've found it to be adequate.

Among commercial libraries, I've had good experiences with pdflib.

draegtun

Three modules for creating PDF come to mind (in no particular order)....

PDF::Template gives you that template option you maybe hankering for?   PDF::Create seems more straightforward (at least from the docs) and may meet your "simple formatting" requirement more adequately.

However if you want to know what the "community" thinks then only PDF::API2 gets a rating on CPAN Ratings coming in with 4 out of 5 stars overall score.

Hope that helps.

PS. Disclaimer: I've not used any of these modules. In past I've always gone for XML/XSLT/XSL-FO using Apache FOP with Perl being used to create the initial XML data. This can be an overkill for something small and not always ideal if you want to embed PDF generation into your Perl app.

PPS. So I'll also be looking at these CPAN PDF modules at some point in near future!

Does it have to be a Perl module? You could always use LaTeX and convert that to PDF. Not quite as straight-forward, but it is another option.

G'day Marcus,

Glad you found the tutorial. I do a lot of work in PDF::API2, so if there's anything I can help with, just let me know.

Naturally, I recommend PDF::API2!

There's a guy Jay Hannah, who's currently turning the text block into a module for CPAN that does exactly what you want: bold, italic, etc. If you check the mailing list, you'll see his posts at the top.

Cheers!

Rick Measham

Yeah, tough to answer without knowing exactly what your constraints are. If pure-Perl is not a necessity, I'd be inclined towards DocBook.

The initial markup you'll generate can be very simple XML; and the transformation requires just an XSL processor and shelling out to something like Apache's FOP.

how to save a online pdf file using perl? http://www.nwcc.bc.ca/FNC/pdfs/Stepping%20Stones%20to%20improved%20Relationships%20-%20web.pdf

I am using file::download. but the problem is its not downloading url with url encoded strings.

sharma

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!