Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   How to use PDF::API2 Perl Module for placing a Banner (http://www.velocityreviews.com/forums/t886160-how-to-use-pdf-api2-perl-module-for-placing-a-banner.html)

Aqua 04-27-2004 10:35 AM

How to use PDF::API2 Perl Module for placing a Banner
 
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

Aandi Inston 04-27-2004 01:00 PM

Re: How to use PDF::API2 Perl Module for placing a Banner
 
junk@dlink.org (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 quite@dial.pipex.com http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.


Aqua 04-28-2004 08:40 AM

Re: How to use PDF::API2 Perl Module for placing a Banner
 
quite@dial.pipex.con (Aandi Inston) wrote in message news:<408e58f5.1091820394@reading.news.pipex.net>. ..
> junk@dlink.org (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 quite@dial.pipex.com 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

Thomas 04-28-2004 08:43 AM

Re: How to use PDF::API2 Perl Module for placing a Banner
 
junk@dlink.org (Aqua) wrote in message news:<55d7995c.0404270235.67dd5876@posting.google. 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


All times are GMT. The time now is 08:10 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.