<?xml version="1.0" encoding="windows-1252"?>
<node id="1014906" title="PDF::Reuse and pdflatex" created="2013-01-23 08:52:01" updated="2013-01-23 08:52:01">
<type id="115">
perlquestion</type>
<author id="894959">
atend</author>
<data>
<field name="doctext">
&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;It seems .pdf-files produced with pdflatex (TeX Live 2012) cannot be used
directly by PDF::Reuse (v. 0.35) (at least not by me).&lt;/p&gt;

&lt;code&gt;
#!/usr/bin/env perl
use strict;
use warnings;
use PDF::Reuse;

open my $fh, '&gt;', 'file.tex' or die $!;
print $fh 
'
\documentclass{article}
\begin{document}
Nothing to see here.
\end{document}
', "\n";

system "pdflatex file.tex";

prFile( 'result.pdf' );
prDoc( 'file.pdf' );
prEnd();
&lt;/code&gt;

&lt;p&gt;This gives:&lt;/p&gt;

&lt;code&gt;
An error occurred 
 at ./pdfperl.pl line 18
 Didn't find pages  
 More information might be found in
   error.log
 at ./pdfperl.pl line 18
&lt;/code&gt;

&lt;p&gt;error.log contains:&lt;/p&gt;

&lt;code&gt;
Didn't find pages 

The error occurred when executing:
 at blib/lib/PDF/Reuse.pm (autosplit into blib/lib/auto/PDF/Reuse/analysera.al) line 5929
	PDF::Reuse::analysera('file.pdf', 1, '') called at blib/lib/PDF/Reuse.pm (autosplit into blib/lib/auto/PDF/Reuse/prDoc.al) line 3562
	PDF::Reuse::prDoc('file.pdf') called at ./pdfperl.pl line 18

Situation when the error occurred

   Bytes written to the current pdf-file,    pos    = 15
   Object processed, not necessarily written objNr  = 3
   Current pdf-file,                         utfil  = result.pdf
   File logging the run,                     runfil = undef
   Local time                                       = Wed Jan 23 14:38:59 2013
&lt;/code&gt;

&lt;p&gt;Anyone have any advice, or a possible fix for this?&lt;/p&gt;</field>
</data>
</node>
