[NTG-context] \dogetobject and pdf

Peter Münster ntg-context@ntg.nl
Thu Jun 10 17:54:19 CEST 2004


On Thu, 10 Jun 2004, Hans Hagen wrote:

> Peter Münster wrote:
> 
> >Hello Hans,
> >I'm sorry, your patch of the May 17 works well for dvi, but not for pdf:
> >the figure is again shifted down and to the left.
> >
> >Here an example:
> >\setupoutput[pdftex]
> >\starttext
> >X\externalfigure[example][width=5cm]X
> >\stoptext
> >
> >example.pdf is attached, also the resulting pdf.
> >
> >
> >Concerning the issus with \useencoding[ffr] and FitBH:
> >Do you think, you could solve the problems? If not, I'll go on trying to
> >find solutions.
> >  
> >
> i ran into that last week as well -)
> 
> can you try:
> 
> \def\dogetobject#1#2#3#4#5#6#7%
>   {\initializepaper
>    \forgetall
>    \dontshowcomposition
>    \setbox\scratchbox\vbox
>      {\doinsertobject{#1}{#2}}%
>    \setbox\scratchbox#3%
>      {\vbox to #5\scaledpoint
>         {\ifdim\ht\scratchbox>#5\scaledpoint
>            \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
>          \else\ifdim\wd\scratchbox>#4\scaledpoint
>            \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
>          \else
>            \vss\box\scratchbox
>          \fi\fi}}%
>    \box\scratchbox
>    \elabelgroup}
> 
> if this does not work i 'll do an upload

pdf ok now, but the dvi is shifted up and to the right... :(

Now I use a workaround in form of an environment:

\startenvironment pdf-figures
\input ifpdf.sty
\ifpdf
\def\dogetobject#1#2#3#4#5#6#7%
  {\initializepaper
   \forgetall
   \dontshowcomposition
   \setbox\scratchbox\vbox
     {\doinsertobject{#1}{#2}}%
   \setbox\scratchbox#3%
     {\vbox to #5\scaledpoint
        {\ifdim\ht\scratchbox>#5\scaledpoint
           \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
         \else\ifdim\wd\scratchbox>#4\scaledpoint
           \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
         \else
           \vss\box\scratchbox
         \fi\fi}}%
   \box\scratchbox
   \elabelgroup}
\fi
\stopenvironment

Greetings, Peter

-- 
http://pmrb.free.fr/contact/
_____________________________________
FilmSearch engine: http://f-s.sf.net/



More information about the ntg-context mailing list