On Sat, 26 Oct 2002 16:09:30 +0200
Matthias Heidbrink
I need to include a PDF picture in a ConTeXt document that is much too detailed to be scaled down onto a single page. So I need to distribute it across two ore more pages.
- Is there a way to display only a part of a PDF file in ConTeXt, like it could be done with manipulation of the bounding box of a PostScript picture in LaTeX?
Since LaTeX can do it it for PDFs too, it should be possible in ConTeXt as well. The problem is that there seems to be no option in the \externalfigure macro for this purpose. Hans knows ...
- Does anyone know an application that will split a PDF file into user-defined parts (not just printing pages)?
- Any other ideas?
Maybe the following can help you. (run texexec with option --automp) %%--- snip --- % output=pdftex interface=en \startMPinclusions def SplitExternalFigure (expr _file, _size, _split, _show) = begingroup; save _xp, _yp ; numeric _xp, _yp ; _xp:= (xpart _size)/(xpart _split) ; _yp:= (ypart _size)/(ypart _split) ; externalfigure _file xyscaled _size ; clip currentpicture to ( (unitsquare xyscaled (_xp,_yp)) shifted (((xpart _show)-1)*_xp,((ypart _show)-1)*_yp) ) ; endgroup; enddef; \stopMPinclusions \startuseMPgraphic{mySplitFigure} SplitExternalFigure( "\MPvar{file}", (\MPvar{size}), (\MPvar{hparts},\MPvar{vparts}), (\MPvar{hshow},\MPvar{vshow}) ) ; \stopuseMPgraphic \starttext % file: file name of your graphic % size: horizontal and vertical size of your graphic % hparts, vparts: split graphic horizontally in hparts % columns and vertically in vparts rows % hshow, vshow: shows after splitting segment in column % hshow and row vshow (hshow=1,vshow=1 means most % lower-left segment) \setupMPvariables[mySplitFigure] [file=myfigure.pdf, size={91.9mm,53.7mm}, hparts=3,vparts=2,hshow=1,vshow=1] % place the splitted figure by name \placefigure{splitted: 3by2, shows segment: 1,1} {\useMPgraphic{mySplitFigure}} \setupMPvariables[mySplitFigure] [hparts=2,vparts=2,hshow=2,vshow=1] \placefigure{splitted: 2by2, shows segment: 2,1} {\useMPgraphic{mySplitFigure}} \stoptext %%--- snap --- Have fun, Jens