flexvault:

I'm not familiar with PDF::Create, either. I briefly looked over the docs, and it looks like the println method might be enough. It doesn't mention tab expansion, so I don't know if the same problem would occur or not.

There's a reference to a set width method, too, so it may let you set line length and do auto wrapping. But I haven't actually tried using it.

...roboticus

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

UPDATE: I went ahead and installed it and gave it a quick try:

#!/usr/bin/perl # # example for PDF::Create # use 5.14.0; use warnings; use autodie; use PDF::Create; my $txt=<<EOT; Here's a little bit of text that contains a very long line followed by + a few short ones so we can see which method(s) may or may not handle + wrapping and embedded newlines, just in case any of them do. Though\tprintnl\tshould\thandle embedded newlines just fine. EOT my $pdf = new PDF::Create('filename'=>'foo.pdf'); my $a4 = $pdf->new_page('MediaBox'=>$pdf->get_page_size('A4')); my $page = $a4->new_page; my $f1 = $pdf->font('BaseFont'=>'Helvetica'); $page->string($f1, 12, 72, 600, $txt); $page->printnl($txt, $f1, 12, 72, 400); $pdf->close;

The result: neither the string nor printnl methods will do autowrapping or any sort of tab expansion other than treating the tabs as spaces (unless my brief scan of the docs missed an option somewhere). The printnl function will at least handle \n nicely.


In reply to Re^3: PDF::Create - help with tabulation by roboticus
in thread PDF::Create - help with tabulation by julio_514

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.