开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜