Imported Page Size

8 views
Skip to first unread message

Beebe

unread,
Aug 10, 2006, 5:27:17 PM8/10/06
to PDF-Reuse
When using prDoc or prSinglePage, pages imported from other documents
are clipped off at 8.5-by-11 inches in size, instead of their actual
size. I can create a page from a blank form in the actual size, about
13-by-22, and insert a page break, prPage, but then when importing via
PrDoc or PrSinglePage the next page is 8.5-by-11, even if I call prMBox
and-or prForm again.
Any suggestion to force imported pages to keep their own size?
My effort is to combine all the individual PDFs of a newspaper into
one big PDF or multy-page PDFs by section.

Lars Lundberg

unread,
Aug 14, 2006, 4:46:51 PM8/14/06
to PDF-...@googlegroups.com
Hello Jeff Beebe,

I am sorry it took a few days for me to answer your email and I am a
little surprised that prDoc and prSinglePage don't keep the mediaboxes
of the original pages, they should.
To test a little I wrote this little snippet. It takes 1 page from each
pdf-document in the current directory and creates one big document.

use PDF::Reuse;
use strict;

my $dir = '.';
my @pdfs;
my $fileName;

opendir(DIR, $dir) || die "Couldn't open directory . \n";

while ($fileName = readdir(DIR))
{ if (($fileName =~ m/\w+\.pdf$/i) && ($fileName ne 'newfile.pdf'))
{ push @pdfs, $fileName;
}
}
closedir(DIR);
prFile('newfile.pdf');
for (@pdfs)
{
prSinglePage($_);
}
prEnd()


It seems to preserve the format of the original pages.
You need to have a late version of PDF::Reuse, preferably version 0.32,
because last year I changed the way prPage and prDoc cooperate. As I see
it, you probably don't need prMbox or prPage if you use prSinglePage.
PDF::Reuse doesn't care about crop-box or bleed-box, just media-box,
but I guess that's not the problem.

If you haven't got any good explanation here, you could send me your
script and and some of your pdf-documents and I can test on my computer.

Best Regards
Lars Lundberg

Reply all
Reply to author
Forward
0 new messages