Hello monks, I have used the super search to try to find an example of how to extract text from a pdf file and attach it to another pdf file, but haven't found any good examples. Any help would be greatly appreciated! here is my code so far:
use PDF::API2; use PDF::Extract; use CAM::PDF; use constant mm => 25.4 / 72; use constant in => 1 / 72; use constant pt => 1; #create pdf file and page my $pdf = PDF::API2->new(-file => "$0.pdf"); my $page = $pdf->page; $font = $pdf->corefont('Helvetica-Bold'); #create a header my $header_text = $page->text; $header_text->font($font, 24); $header_text->translate(105/mm, 250/mm); $header_text->fillcolor('black'); $header_text->text_center('Thank you for your business!'); $pdf-> save();
I added the CAM::PDF modules and PDF::Extract modules because that is what I found. I just haven't figured out to use them yet.. I want to open a file in the working folder called pdfone.pdf and write it to file I created in the code I posted

In reply to PDF extract by PerlSufi

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.