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.
See if the API talks about "form XObjects". If it does, you may be on
to something.
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