Adding text, merge with 2nd pdf and upload it

Discussion in 'Perl Misc' started by ccampise@gmail.com, Sep 28, 2006.

  1. Guest

    Hello all-

    I'm attempting to take two existing pdf files, add text to them, merge
    them into 1 single pdf, then stream that pdf to a browser allowing the
    user to download the modified-single file.

    I have no problem when adding text to a single document, and then
    streaming that. The text shows up correctly in the downloaded pdf.

    The problem is when I add text to > 1 document, merge them into a
    single document, and stream the single document. The downloaded pdf
    file doesn't contain any of the text I added, although it does merge
    them correctly.

    My current code :

    sub stream {
    my $self = shift;

    my $dest_pdf_filename = "my_first.pdf";
    my $source_pdf_filename = "my_second.pdf";

    my $source_pdf = PDF::API2->open( $source_pdf_filename );
    my $dest_pdf = PDF::API2->open( $dest_pdf_filename );

    my $page = $source_pdf->openpage(1);

    $page->text->textlabel(
    60,
    681,
    $source_pdf->corefont('Arial'),
    45,
    'TEST');

    $dest_pdf->importpage( $source_pdf, 1);

    my $cgi = new CGI;

    print $cgi->header(
    -type => "application/pdf",
    -attachment => "forms.pdf",
    );

    $dest_pdf->stringify;

    return;
    }

    Any thoughts or ideas on this would be greatly appreciated!

    Chris
    , Sep 28, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?a3Jz?=

    merge .pdf files

    =?Utf-8?B?a3Jz?=, Apr 6, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,695
    flo2007
    Jun 1, 2007
  2. oyster
    Replies:
    2
    Views:
    420
    David Boddie
    May 26, 2009
  3. Ricardo Pog
    Replies:
    1
    Views:
    420
    Austin Ziegler
    Mar 26, 2008
  4. Sean Nakasone
    Replies:
    1
    Views:
    362
    Farrel Lifson
    Apr 14, 2008
Loading...

Share This Page