Hi, I have a problem with PDF::Report.

I can generate the PDF without problems, but when I add a barcode, I can not open the file because it says the file is corrupt. When only text and lines, is generated correctly, but when I insert the barcode the file does not open

I think it's a problem with the parameters sent to the function.

Then leave the code snippet I am using.

my $pdf = new PDF::Report(PageSize => "A4", PageOrientation => "Portra +it"); $pdf->newpage( 0 ); $pdf->openpage( 0 ); $pdf->setSize( 8 ); $pdf->addRawText("Hola Mundo",300, 300); my $code = '31570918'; $pdf->drawBarcode(300, 500, 1, 1, '3of9', '31570918', '012345', 9+$zon +e, 9+$zone, 3+$zone, 0, '-', 0.5, 9, ''); print "Content-Disposition: attachment; filename=\"carnet.pdf\"\n\n"; print "Content-type: application/pdf\n\n"; print $pdf->Finish();

Worth mentioning is a web system, from which I generate patron cards.


In reply to PDF::Report and barcode generation by hectorejch

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.