Dear Monks. I am new to perl and have been using the excellent PDF::API2 module.

I wish to create a series of paragraphs on a document so that the text flows from one to the other.

I can successfully create a paragraph using the following code

My paragraph is

my $paragraph="erci ent ulluptat vel eum zzriure feuguero core conseni +s adignim irilluptat praessit la con henit velis dio ex enim ex ex eu +guercilit il enismol eseniam, suscing essequis nit iliquip erci blam +dolutpatisi. Orpero do odipit ercilis ad er augait ing ex elit autatio od minisis a +mconsequam";

And my code snippet is

my $txt=$page->text; $txt->textstart; $txt->lead(7); $txt->font( $font{'Helvetica'}{'Bold'}, 7 / pt ); $txt->fillcolor('red'); $txt->translate(30,265); $txt->paragraph("$paragraph", 40 /mm, 70, align => "left" );

What I need to do is to collect the text that does not fit into this paragraph (i.e. the overflow text) into a variable $overflow_text. Then I can use the contents of $overflow_text to place the remaining text into another paragraph object. There appears to be some reference to overflow text in the documentation but I cannot quite get my head around it

Thanks for your help


In reply to PDF::API2 Paragraphs and Overflow Text by dickieb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.