[question] \clipping some data from a pdf
![](https://secure.gravatar.com/avatar/aaec8862a4c7f861ffc1f105419e1805.jpg?s=120&d=mm&r=g)
Does anyone know? Using the latest LMTX, i try to clip some portion of an external pdf page, then resize that portion on top a new page. i use the \clip command. \starttext \scale[width=100mm, hwight=100mm]{\clip[width=150mm, height=120mm, hoffset=30mm, voffset=40mm]{\externalfigure[drawing.pdf]}} % incorrect \scale[width=100mm, hwight=100mm]{\clip[width=150mm, height=120mm, hoffset=30mm, voffset=136mm]{\externalfigure[drawing.pdf]}} % correct \stoptext I noticed that the voffset parameter *always* counts from the top/left of the external source. Also if the source has its origin defined at the lower/left corner. Is that intentional? It is confusing as when i place a rectangle on top of the clip i want to extract from the source pdf, the x,w,w,h of that rectangle will not match the parameter needed for the \clip command. Or does there happen to be some snazzy tool out there to get the coordinates of embedden images within a pdf? .Floris
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
Am 2020-01-29 um 00:27 schrieb Floris van Manen
: Or does there happen to be some snazzy tool out there to get the coordinates of embedden images within a pdf?
In case the "right" size of your image is defined as one of the PDF boxes (MediaBox, TrimBox, CropBox, ArtBox), you can set \externalfigure[drawing][size=art] (size=none/media/crop/trim/art). Best, Hraban
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Wed, 29 Jan 2020, Henning Hraban Ramm wrote:
Am 2020-01-29 um 00:27 schrieb Floris van Manen
: Or does there happen to be some snazzy tool out there to get the coordinates of embedden images within a pdf? In case the "right" size of your image is defined as one of the PDF boxes (MediaBox, TrimBox, CropBox, ArtBox), you can set \externalfigure[drawing][size=art] (size=none/media/crop/trim/art).
This was documented at https://www.contextgarden.net/Command/useexternalfigure but I also added a short description at https://www.contextgarden.net/Using_Graphics Aditya
participants (3)
-
Aditya Mahajan
-
Floris van Manen
-
Henning Hraban Ramm