Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to use PDF::API2 Perl Module for placing a Banner

Reply
Thread Tools

How to use PDF::API2 Perl Module for placing a Banner

 
 
Aqua
Guest
Posts: n/a
 
      04-27-2004
Group,

Could someone point me to a tutorial for PDF::API2 usage? (or samples
etc) Really I dont know how to start.

Basically I wanted to place a small banner (another PDF) in each page
of original PDF. How to do this?

Thanks for your time

Dominic
 
Reply With Quote
 
 
 
 
Aandi Inston
Guest
Posts: n/a
 
      04-27-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Aqua) wrote:

>Group,
>
>Could someone point me to a tutorial for PDF::API2 usage? (or samples
>etc) Really I dont know how to start.


If you want to use any software that edits PDFs, a basic working
knowledge of the PDF format is a must. All editors are shaped and
constrained by what PDF is, and how it works, and it will be a real
struggle without that basic knowledge.

Read the PDF Reference, at least the first five chapters.
>
>Basically I wanted to place a small banner (another PDF) in each page
>of original PDF. How to do this?


See if the API talks about "form XObjects". If it does, you may be on
to something.
----------------------------------------
Aandi Inston (E-Mail Removed) http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.

 
Reply With Quote
 
 
 
 
Aqua
Guest
Posts: n/a
 
      04-28-2004
(E-Mail Removed) (Aandi Inston) wrote in message news:<(E-Mail Removed)>. ..
> (E-Mail Removed) (Aqua) wrote:
>
> >Group,
> >
> >Could someone point me to a tutorial for PDF::API2 usage? (or samples
> >etc) Really I dont know how to start.

>
> If you want to use any software that edits PDFs, a basic working
> knowledge of the PDF format is a must. All editors are shaped and
> constrained by what PDF is, and how it works, and it will be a real
> struggle without that basic knowledge.
>
> Read the PDF Reference, at least the first five chapters.
> >
> >Basically I wanted to place a small banner (another PDF) in each page
> >of original PDF. How to do this?

>
> See if the API talks about "form XObjects". If it does, you may be on
> to something.
> ----------------------------------------
> Aandi Inston (E-Mail Removed) http://www.quite.com
> Please support usenet! Post replies and follow-ups, don't e-mail them.


Aandi,

Actually I am able to do this with PDF::Reuse and PDF::API2.

This is just a sample code. Using Reuse I cut the PDF into individual pages

for( $i = 0; $i < $TotalPgs; $i++ ) {
$CurrPg = $i + 1;
print "Creating PDF File for Page: $CurrPg\n";
prFile( "DOMTMP$CurrPg.pdf");
prDoc( { file => "$SFile",
first => $CurrPg,
last => $CurrPg });
prEnd();
}

Using PDF::API2 I am createing a new page with a banner and individual PDF pages.

$pdf2 = PDF::API2->open("$ArtPDF");
$pdf = PDF::API2->new;

$img = $pdf->pdfimage("$ArtPDF", 1);

$page = $pdf->page;
$page->mediabox(595, 842);

$gfx = $page->gfx;
$gfx->pdfimage($img, 0, 0, 1);

$imgx = $pdf->pdfimage("$HeadPDF", 1);

$gfx = $page->gfx;
$gfx->pdfimage($imgx, 40, 780, 1);

print "Creating new DOMTMP$PgCnt.pdf\n";
$pdf->saveas("DOMTMP$PgCnt.pdf");

$pdf->end();
$pdf2->end();

Then I am joining PDF pages using Reuse.

prFile("$OFile");
for( $i = 0; $i < $TotalPgs; $i++ ) {
$CurrPg = $i + 1;
prDoc( "DOMTMP$CurrPg.pdf" );
}
prEnd();

This logic may not be a direct one but it works perfectly.

Regards
Dominic
 
Reply With Quote
 
Thomas
Guest
Posts: n/a
 
      04-28-2004
(E-Mail Removed) (Aqua) wrote in message news:<(E-Mail Removed). com>...
> Group,
>
> Could someone point me to a tutorial for PDF::API2 usage? (or samples
> etc) Really I dont know how to start.
>
> Basically I wanted to place a small banner (another PDF) in each page
> of original PDF. How to do this?
>
> Thanks for your time
>
> Dominic


http://groups.yahoo.com/group/perl-text-pdf-modules/

Alfred Reibenschuh is the maintainer...but also some other people
there should be able to help u ! (i guess its possible)

best regards
Thomas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
IIS Password Change solution documentation ? How to use anot3.asp ?(security banner ?) Pascal ASP General 0 04-04-2008 09:55 AM
Can text in a Flash banner be changed by Perl? Tony Perl Misc 1 08-12-2006 10:58 AM
how to use Perl module - Perl Magick??? i am a newbie. jadkit@gmail.com Perl Misc 2 02-06-2006 05:59 PM
perl bug with pos() and placing matches in an array? t13_e@yahoo.com Perl Misc 6 03-17-2005 04:55 AM



Advertisments