zaboti has asked for the wisdom of the Perl Monks concerning the following question:
The output i get:#!/usr/bin/perl use PDF::API2; print "start ".(localtime)."\n"; $pdf = PDF::API2->open("sample.pdf"); $page = $pdf->openpage(1); $page->mediabox(840,600) $gfx=$page->gfx; print "first image ".(localtime)."\n"; $first=$pdf->image_png("first.png"); print "inserting first image ".(localtime)."\n"; $gfx->image($first,134,106,510,281); print "saving ".(localtime)." \n"; $pdf->saveas('new_file.pdf'); print "done ".(localtime)." \n";
So the most time consuming process is image_png which takes 22 seconds in this example... Any help would be appreciated. Thanksstart Mon Jun 3 10:46:31 2013 first image Mon Jun 3 10:46:31 2013 inserting first image Mon Jun 3 10:46:53 2013 saving Mon Jun 3 10:46:53 2013 done Mon Jun 3 10:46:57 2013
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PDF::API2 image_png slow
by rpnoble419 (Pilgrim) on Jun 03, 2013 at 15:20 UTC |