[pdftex] pdftex and metapost and png files

Hans Hagen pragma at wxs.nl
Fri Jul 1 10:55:03 CEST 2005


Geoff Russell wrote:
> Hi,
> 
> I have a graphic format compatibility problem.
> 
> I want to include a png image in a metapost picture and
> am trying to use
> 
> 	verbatimtex
>      \input graphicx
>      etex
> 
>      ...
> 	beginfig(1);
>      label(btex \includegraphics{xxx.png} etex,z0);
> 	endfig;
> 	end
> 
> 
> When I run metapost with TEX=tex then \pdfimage isn't defined, and if
> I run it with TEX=pdftex then it is producing pdf and metapost can't
> read it. If I change pdftex.cfg to ask for dvi, then the png isn't
> recognised.
> 
> Is there a way around this? I'd prefer pdftex if possible.

In context/metapost this is possible:

\setupoutput[pdftex]
\setupcolors[state=start]

\starttext

\startMPpage[offset=1pt]
     externalfigure "hacker.jpg" xscaled 5cm yscaled 4cm ;
     picture p ; p := btex TEST etex 
xysized(bbwidth(currentpicture),bbheight(currentpicture)) ;
     draw p shifted (center currentpicture - center p) withcolor red ;
\stopMPpage

\stoptext

if you use another macro package, you can still use context to make independent 
graphics and then include them as pdf graphic

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
-----------------------------------------------------------------



More information about the pdftex mailing list