Adding text, merge with 2nd pdf and upload it



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

.



Relevant Pages

  • Re: .NET 2.0 Web App - streaming PDF
    ... I was able to use your code successfully to stream the PDF into the browser ... using Visual Web Developer Express. ... Dim stream1 As IO.FileStream ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: PDF Primary Hint Stream
    ... I have not clew what a hint stream is? ... of linearized PDFs on the web. ... Can we create a PDF sample from Acrobat and almost all the Linearized ...
    (comp.text.pdf)
  • RE: Stream pdf to browser
    ... from backend file or database and stream them to web application(let web ... application flush the pdf content to client). ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Need help with WebBrower Control
    ... I've not streamed from a string, I've only streamed PDF using ... Response.ContentType = "application/doc" for the Word file. ... stream into the WebBrowser control. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Detect click on a link
    ... Create a general page that can stream PDF's to users. ... You can also stream the pdf to the user. ... > I wanted to log a custom message when the user opens a link to a .pdf: ... > Public Sub OnDownload ...
    (microsoft.public.dotnet.framework.aspnet)