开发者

How can I suppress warnings emitted by Perl's PDF::Reuse?

开发者 https://www.devze.com 2023-01-23 20:03 出处:网络
Is there a way 开发者_JS百科to suppress warnings & error messages in PDF::Reuse? (I don\'t need the warnings...if this part of the script fails for any particular pdf then its ok.)

Is there a way 开发者_JS百科to suppress warnings & error messages in PDF::Reuse? (I don't need the warnings...if this part of the script fails for any particular pdf then its ok.) I've tried the following but it doesn't seem to work:

eval {
local $SIG{ALRM} = sub {die "alarm\n"};
alarm 10;

    { 
    local $SIG{__WARN__}=sub{}; 
    use PDF::Reuse;                      
    prFile( $copyPdf ); 
    prDoc(  $file ) ; 
    prEnd() or next;
    }

alarm 0;
}; 

if ($@) {
die unless $@ eq "alarm\n";
print "timed out\n";
}


What warnings are you seeing?

I tried the above script with a PDF I had lying around and got no errors or warnings. perl 5.8.8, PDF::Reuse 0.35.

Is the problem that one of your PDFs is badly formed?

0

精彩评论

暂无评论...
验证码 换一张
取 消