http://qs321.pair.com?node_id=11115230


in reply to PDF::API2 behaving differently on two computers?

Can you reduce the program to a very short program that still exhibits the problem? I'm thinking of something like:

#!perl use strict; use warnings; use PDF::API2; print "Using PDF::API2 version $PDF::API2::VERSION\n"; my $pdf = PDF::API2->new; my $bg_file = 'watermark.pdf'; my $bg = $pdf->importPageIntoForm( $bg_file, 1 ); # ... $page->gfx->formimage( $bg, 0, 0, 1.0 ) # write to another file

That would help me understand your steps better and maybe point out where the problem(s) might lie.

Replies are listed 'Best First'.
Re^2: PDF::API2 behaving differently on two computers?
by trillich (Sexton) on Apr 08, 2020 at 20:42 UTC

    Aha, this was a helpful kick in the pants. When I do a simple script as you suggest, everything works swimmingly. So there's something in the home-grown modules in between, that we are using, that's corrupting things. So at least I have a starting point for sleuthing now.

    One thing I've noticed in the past, is that I must disable $pdf->{forcecompress} = 0. Sometimes it's okay even with forcecompress left enabled, other times it really scrambles the presentation when displaying via a PDF reader (text enormous or skewed or mispositioned on the page). Turning it off makes it so there's dependable display of the results.

    Is that common -- where forcecompress causes issues?