Changes

Jump to navigation Jump to search
486 bytes added ,  04:10, 1 June 2020
m
→‎Visualize Bounding Box: <pre> no longer processes tags ...
<pre>
\startluacode
 figures.converters["jpg"]["lowres.jpg"] =local functionconverter(oldname,newname,resolution) if not resolution or resolution == "" then resolution = 50 end os.execute(string.format( 'gm convert -density %ix%i "%s" "%s"', resolution,resolution,oldname,newname) )
end
-- Set the PDF and default TIFF converters to the above function.
figures.converters.tif.pdf = converter
figures.converters.tif.default = converter
\stopluacode
\starttext
% Substitute any TIFF here. \externalfigure [t:/sources/hacker.jpg] [conversion=lowrescow.jpg,resolution=50,width=10cmtiff]
\stoptext
</pre>
<texcode>\clip[nx=3,ny=3,x=2,y=2]
{\externalfigure[logo.pdf]}</texcode>
 
 
In PDF files, it is possible to specify different size information in PDF headers MediaBox, TrimBox, CropBox, and ArtBox. To clip to one of these sizes, use
 
<texcode>\externalfigure[logo.pdf][size=art]</texcode>
 
Other options are: `none` (detault), `media` for MediaBox, `crop` for CropBox, `trim` for TrimBox, and `art` for ArtBox.
= Troubleshooting =
ConTeXt includes a Perl script <tt>pdftrimwhite</tt> that removes extra white space at the borders of a PDF file. To run this script:
<pre>mtxrun --script pdftrimwhite <em>[flags] input output</em></pre>
The most important flag is <tt>--offset=dimen</tt>, which keeps some extra space around the trimmed image.

Navigation menu