Hi, Monks.
I have a problem when merging PDF documents. I need to import first page from many one page PDF documents into one result PDF.
I try PDF::API2, PDF::Reuse, CAM::PDF but nothing helps :-(. My main problem is importing barcode from source PDF (see example 1 33 kb, example 2 33 kb). My program got this pdfs from USPS site and i need to create single PDF from them.
PDF::API2 and CAM::PDF don't show barcode at all. PDF::Reuse show barcode only on first page :-( (see PDF::API2 result 53 kb, CAM::PDF result 54 kb, PDF::Reuse result 65 kb).
Here my code.
For PDF::API2:
use PDF::API2; my $result_pdf = PDF::API2->new(); my $pdf = PDF::API2->open('label1.pdf'); my $page = $result_pdf->importpage($pdf, 1); $pdf = PDF::API2->open('label3.pdf'); $page = $result_pdf->importpage($pdf, 1); $result_pdf->saveas("pdfapi2_result.pdf");
For CAM::PDF:
use CAM::PDF; my $doc1 = CAM::PDF->new('label1.pdf') || die "$CAM::PDF::errstr\n"; my $doc2 = CAM::PDF->new('label3.pdf') || die "$CAM::PDF::errstr\n"; $doc1->appendPDF($doc2); $doc1->clearAnnotations(); $doc1->cleanoutput('campdf_result.pdf');
And for PDF::Reuse which works but only for first page:
use PDF::Reuse; prFile('new.pdf'); prDoc( { file => 'label3.pdf', first => 1, last => 1 }); prDoc( { file => 'label1.pdf', first => 1, last => 1 }); prEnd();
Could you explain why barcodes did't copy? What i must to do to copy them?
P.S. When i wrote this message i think about Javascript in the PDF. Maybe barcodes are creating by Javascript? And when i importing page from source file i'm importing Javascript but maybe this Javascript only generates barcode for the first page?
In reply to Problem importing page from PDF by Gangabass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |