Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Using PDF::Textblock

by roboticus (Chancellor)
on Aug 07, 2014 at 10:51 UTC ( [id://1096593]=note: print w/replies, xml ) Need Help??


in reply to Using PDF::Textblock

Shivangi17:

Looking at the docs for PDF::TextBlock, the apply method returns the text that didn't fit in the block. So I'd suggest following the apply with apply in a loop to create a new page as long as overflow isn't empty. I've not used the module before, but from the docs it appears that it should be something like this:

my ($endw, $ypos, $overflow) = $tb->apply(); while ($overflow ne '') { $tb = PDF::TextBlock->new( ... ); $tb->text("<i>Continued...</i><br/>" . $overflow); ($endw, $ypos, $overflow) = $tb->apply(); }

Since the text on successive pages are a continuation, you may want to alter the starting position and size of your text block, as well as handle any 'continued' message(es).

Update: Added a missing space (applyin --> apply in).

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1096593]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-19 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found