Trouble with PDF::API2 paragraph function

We have some ancient code for printing documents that relied on the PDF::API2 module. When we upgraded our systems, this module has some different behavior and our program was throwing errors.
First, I commented out the “pdf->page->text->compress” function calls and that helped. But some text was not showing up. Turns out the “text->paragraph” function totally changed. Thankfully google led me to this page where I found the proper way to update my paragraph calls:

OLD
$text->paragraph("Hello, just a test."x10, -x => 300, -y => 600, -h => 600, -w => 200);

NEW
$text->translate( 300, 600 );
$overflow = $text->paragraph( "Hello, just a test. "x10, 200, 600 );

Scary note at the bottom, but applying the change above worked for me!
DEVELOPER METHOD means:
1. This method may not do anything useful.
2. This method may erase your hard disk(s).
3. This method may erase the hard disks on any machine your machine is connected to.
4. This method is subjected to change *without* notice.

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Trouble with PDF::API2 paragraph function

Leave a Reply to Justin Catterall Cancel reply

Your email address will not be published. Required fields are marked *