Difference between revisions of "Command/setupclipping"

From Wiki
Jump to navigation Jump to search
m (Text replace - "\[\[cmd:(.*)\|(.*)\]\]" to "{{cmd|$1}}")
m (General improvery)
Line 46: Line 46:
 
   </tr>
 
   </tr>
 
</table>
 
</table>
 
  
 
== Description ==  
 
== Description ==  
<pre>
+
Specify the default clipping settings. There are three methods:
Clip method:
 
  
A) Tiles
+
A) Tiles, where
nx, ny: tiles contents to nx horizntal (ny vertical) equal sized pieces
+
* <code>nx</code>, <code>ny</code> specify to cut the contents into <code>nx</code> horizontal (<code>ny</code> vertical) pieces of equal size, and
x, y : choose x (y) piece
+
* <code>x</code>, <code>y</code> choose the piece at x (, y).
  
B) size/offset
+
B) size/offset, where
width, height: horizontal (vertical) size of clipping window
+
* <code>width</code>, <code>height</code> specify the horizontal (vertical) size of the clipping window, and
hoffset, v offset: window shift
+
* <code>hoffset</code>, <code>voffset</code>: window shift
  
 
C) metapost path
 
C) metapost path
mp:
+
* <code>mp</code>:
 
</pre>
 
</pre>
 
  
 
== Example ==
 
== Example ==
  
 +
To clip, from page 3 of a PDF, a piece of 60x25, 25 mm from the left edge of the paper and 18+25 mm from the top (assuming A4 paper):
 
<texcode>
 
<texcode>
\starttext
 
\startTEXpage
 
 
\clip
 
\clip
  [width=60mm,height=25mm,hoffset=25mm,
+
  [width=60mm,
  voffset=\dimexpr 297mm-18mm-25mm\relax]
+
    height=25mm,
  {\externalfigure[file.pdf][page=3]}%
+
    hoffset=25mm,
\stopTEXpage
+
    voffset=\dimexpr 297mm-18mm-25mm\relax]
\stoptext
+
  {\externalfigure[file.pdf][page=3]}%
 
</texcode>
 
</texcode>
 
  
 
== See also ==
 
== See also ==
{{cmd|clip}}
+
* {{cmd|clip}}
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==

Revision as of 23:12, 21 May 2012

\setupclipping

Syntax

\setupclipping[...,...=...,...]
nx number
ny number
x number
y number
width dimension
height dimension
hoffset dimension
voffset dimension
mp name

Description

Specify the default clipping settings. There are three methods:

A) Tiles, where

  • nx, ny specify to cut the contents into nx horizontal (ny vertical) pieces of equal size, and
  • x, y choose the piece at x (, y).

B) size/offset, where

  • width, height specify the horizontal (vertical) size of the clipping window, and
  • hoffset, voffset: window shift

C) metapost path

  • mp:

Example

To clip, from page 3 of a PDF, a piece of 60x25, 25 mm from the left edge of the paper and 18+25 mm from the top (assuming A4 paper):

\clip
   [width=60mm,
    height=25mm,
    hoffset=25mm,
    voffset=\dimexpr 297mm-18mm-25mm\relax]
   {\externalfigure[file.pdf][page=3]}%

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: