ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
CAM::PDF renderpdf.pl broken?
by Phillip Richcreek other posts by this author
Jun 18 2009 7:03PM messages near this date
view in the new Beta List Site
Re: Need help with my code | MSDOS Path
This message is going to the CAM::PDF author as well as the
ActiveState perl-win32-users mail list.

For about two years, I've been running a program that uses CAM::PDF to
break a PDF file into individual pages and processes each page using a
utility distrubuted with CAM::PDF, renderpdf.pl, to extract a text
image of each page and perform further processing on it. After
installing perl 5.10 and 1.52 of CAM::PDF, renderpdf.pl no longer
works. It reports no errors, but returns no text to my program.
Although I hadn't until now run renderpdf.pl directly from the command
line, since it's behavior changed when executed with qx in my program,
I've run it from the command line with the same result -- nothing
printed to SYSOUT. I've also run the debugger on renderpdf.pl, but
I've been unable to spot where anything is going wrong.

Here are a few lines from my program surrounding the execution of renderpdf.pl:

               use strict;
               use warnings;
                <snip> 

	my $pdf = CAM::PDF-> new($checks) || die "$CAM::PDF::errstr\n";
	if (!$pdf-> extractPages($pagenum))
	{die "Failed to extract page number $pagenum\n";}	
                $pdf-> preserveOrder();
	if (!$pdf-> canModify())
	{die "This PDF forbids modification\n";}

	$thisCheck=$singleCheck;
	$thisCheck=~s/pagenum/$pagenum/;
	logit("output name is $thisCheck\n",$silent);
	if (!$pdf-> cleanoutput("$thisCheck")) {
	   log_and_die("CAM PDF ERROR: $CAM::PDF::errstr\n".
	                      "cleanoutput Failed to output page $pagenum\n",-74)
	}
	
	@renderedText=qx{renderpdf.pl --verbose
--renderer=CAM::PDF::Renderer::Text "$thisCheck" 1};
	if ($? == -1)
	   { log_and_die("renderpdf.pl failed to execute: $!\n",-79); }
                elsif (($? > > 8)!=0)
                  { log_and_die("renderpdf.pl exited with value ".($?
> > 8),-78) }

I've compared the 1.52 version of renderpdf.pl to the 1.13 version and
there are no differences except the version number and an apparently
inconsequential change in an eval.

                 eval "require $opts{renderer}";  ## no critic for string eval
                 if ($EVAL_ERROR)
                 {
                    die $EVAL_ERROR;
                 }

                if (!eval "require $opts{renderer}")  ## no critic (StringyEval)
                {
                    die $EVAL_ERROR;
                }

I'm hopeful that the author will have time to take a look at this or
that someone who subscribes to the mailing list has an idea how I
might proceed to debug this.

TIA,

Phil
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved