{"id":424,"date":"2012-02-16T18:52:14","date_gmt":"2012-02-16T18:52:14","guid":{"rendered":"http:\/\/www.omniweb.com\/wordpress\/?p=424"},"modified":"2012-02-16T18:53:06","modified_gmt":"2012-02-16T18:53:06","slug":"trouble-with-pdfapi2-paragraph-function","status":"publish","type":"post","link":"https:\/\/www.omniweb.com\/wordpress\/?p=424","title":{"rendered":"Trouble with PDF::API2 paragraph function"},"content":{"rendered":"<p>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.<br \/>\nFirst, I commented out the &#8220;pdf->page->text->compress&#8221; function calls and that helped.  But some text was not showing up.  Turns out the &#8220;text->paragraph&#8221; function totally changed.  Thankfully google <a href=\"http:\/\/osdir.com\/ml\/lang.perl.modules.pdfapi2\/2005-02\/msg00037.html\">led me to this page<\/a> where I found the proper way to update my paragraph calls:<\/p>\n<p>OLD<br \/>\n<code>$text->paragraph(\"Hello, just a test.\"x10, -x => 300, -y => 600, -h => 600, -w => 200);<\/code><\/p>\n<p>NEW<br \/>\n<code>$text->translate( 300, 600 );<br \/>\n$overflow = $text->paragraph( \"Hello, just a test. \"x10, 200, 600 );<\/code><\/p>\n<p>Scary note at the bottom, but applying the change above worked for me!<br \/>\n<code>DEVELOPER METHOD means:<br \/>\n1. This method may not do anything useful.<br \/>\n2. This method may erase your hard disk(s).<br \/>\n3. This method may erase the hard disks on any machine your machine is connected to.<br \/>\n4. This method is subjected to change *without* notice.<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;pdf->page->text->compress&#8221; function calls and &hellip; <a href=\"https:\/\/www.omniweb.com\/wordpress\/?p=424\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/424"}],"collection":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=424"}],"version-history":[{"count":2,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":426,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/424\/revisions\/426"}],"wp:attachment":[{"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.omniweb.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}