Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the best Perl module to use for creating a .pdf from scratch?
    text
    copied!<p>There are quite a number of modules on CPAN relating to the creation and manipulation of .pdf files, and I'm hoping this community can save me some time going down blind alleys.</p> <p>I am looking to create .pdf files from scratch, with only simple formatting such as bold/italic and left/right/center justify. Being able to use a template file would nice, from an MVC perspective, but if the best module doesn't support that, I'm ok. I want the best module for my narrow problem set. </p> <p><strong>Edit:</strong> let's add the constraint that it does have to be a Perl module, if not a pure-perl solution. Thanks for answers thus far!</p> <p><strong>Update</strong>: PDF creation is one difficult problem to decide how to approach. In addition to the good suggestions here, there seems to be about 1,000 different ways to solve this, and knowing which solution(s) to invest your time in is a real challenge. It is easy to acquire dependencies on outside executables in the process of building this solution, which is why I have been favoring doing everything in Perl if possible.</p> <p>I went down the road of trying to use PDF::Create but found it too limiting. You have to give coordinates to place each string of text and there is no built-in concept of text wrapping... this is all work you have to do. Impossible amount of overhead for my task.</p> <p>I am now using PDF::API2, which is much more powerful than PDF::Create, but still demands the PDF be assembled at a troublingly low level. Luckily, there is some help online. See <a href="http://rick.measham.id.au/pdf-api2/" rel="noreferrer">Rick Measham's excellent PDF::API2 tutorial with accompanying text_block() subroutine</a>, which thankfully does the heavy lifting on the text wrap problem.</p> <p>Unless you see another update here, this is the solution that ended up working for me.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload