[NTG-pdftex] pdfannot in xform

Hans Hagen pragma@wxs.nl
Fri, 02 Jul 2004 15:56:14 +0200


Hi Heiko,

>d not consider the current low level interface of image
>inclusion as "user friendly". This should be done at macro level:
>  graphicx/pdftex.def for plain/latex and your interface in
>  ConTeXt.
>  
>
sure (i always do a file existence test) but we're now wrapping up 
problems in  pdftex, and there the low level interface (primitives) 
shoudl work without problems. I consider a faulty result file as a bug 
as will most naive users -)

>This case is handled by LaTeX's graphics.sty, it calls the LaTeX
>kernel macro \IfFileExists.
>  
>
something simlar happens in context

>It costs a lot of time to write pi as decimal number ... ;-)
>  
>
how many nanoseconds -) nothing compared to what pdftex is doing the 
rest of teh time

>Perhaps someone will update the documentation of pdfTeX.
>1pt is easier to explain as 3.141592pt:
>* Why not 3.14159pt:
>  \newdimen\foo
>  \foo=3.141592pt
>  \showthe\foo
>  % 3.14159pt
>  \newdimen\bar
>  \bar=3.14159pt
>  \ifdim\foo=\bar
>    \message{EQUAL}
>  \else
>    \message{NOT EQUAL}
>  \fi
>  % EQUAL
>* Testing for such a value implicates that then this value is
>  forbidden for pdf page sizes. This complicates the documentation
>  and this limitation is not necessary at all (\pdflastximagepages
>  is much better here).
>  
>
the pi points was just 'some value' ; in principle any value will do;  
it's not so much meant for testing but more to have something back 
instead of something invalid

>Behaviour of pdfTeX for pdf image inclusion:
>
>DEFAULT  := -1 or 0 (see below)
>Continue := Continue with empty xform object with dimension 1pt x 1pt.
>
>if PDFFileExists
>    if PageNumber < 1
>        \pdflastximagepages = DEFAULT
>        Warning "Invalid page number"
>        Continue
>    elsif PageNumber > \pdflastximagepages
>        \pdflastximagepages is set
>        Warning "Page number to large (out of range)
>        Continue
>    else
>        \pdflastximagepages is set
>        image is included
>    fi
>else
>    Warning "PDF file does not exist"
>    \pdflastximagepages = DEFAULT
>    Continue
>fi
>  
>
this sounds ok to me  (an option is: -1 does not exist and -2 invalid)

>Thus \pdflastximagepages = DEFAULT means:
>"pdf file is not read" because of:
>* No \pdfximage command, program start
>* Invalid page number in previous call of \pdfximage
>* Call with valid page number, but pdf file does not exist.
>
>The value DEFAULT can be discussed. I have not found in the
>pdf specification that pdf files with zero pages are forbidden.
>Therefore I would prefer "-1", but the current default at
>program start is "0".
>  
>
A pdf file can indeed contain zero pages (for instance a xfdf file,  or 
a file with only templates), so we should stick to <0 values

Hans

 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------