hesco has asked for the wisdom of the Perl Monks concerning the following question:
In fact, I reported success in my own experiment in that realm. But now I have a pdf generated using scribus, which I need to overwrite with a small piece of unique data.
Will the source of a PDF file or how it is initially created going to determine whether I can add text on top of an existing design?
-- Hugh
UPDATE:
OK, so here is the code I'm working with, currently reads more or less:
But I also have commented out, an attempt to use PDF::Reuse, as well.#!/usr/bin/perl -w use strict; use warnings; use PDF::API2; my $TEMPLATE = '/path/to/scribus/generated/pdffile.pdf'; my $RESULT_PDF = '/path/to/script/generated/pdf_result_file.pdf'; my $INSTANCE = 'Print this code on form'; my $pdf = PDF::API2->open($TEMPLATE); my $page = $pdf->openpage('1'); my $text = $page->text(); my $font = $pdf->corefont('Helvetica'); # prepare text object $text->font($font,48); # Set font to Helvetica, 11pt $text->fillcolor("#222222"); # This is black $text->translate(173,660); # Text start location for Corp chk box $text->text("$INSTANCE"); # Print "X" at 173,660 $pdf->saveas($RESULT_PDF); $pdf->end; # print status message: print STDERR "Efforts to automate pdf generation still under developme +nt.\n"; print STDERR "For the moment, please do this manually. Thanks.\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding text to existing pdf file.
by almut (Canon) on Dec 16, 2007 at 13:59 UTC | |
|
Re: Adding text to existing pdf file.
by almut (Canon) on Dec 16, 2007 at 21:31 UTC |