ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [question] \clipping some data from a pdf
@ 2020-01-28 23:27 Floris van Manen
  2020-01-29  6:04 ` Henning Hraban Ramm
  0 siblings, 1 reply; 3+ messages in thread
From: Floris van Manen @ 2020-01-28 23:27 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

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


[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 2497 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [question] \clipping some data from a pdf
  2020-01-28 23:27 [question] \clipping some data from a pdf Floris van Manen
@ 2020-01-29  6:04 ` Henning Hraban Ramm
  2020-01-30 13:55   ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Hraban Ramm @ 2020-01-29  6:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 2020-01-29 um 00:27 schrieb Floris van Manen <vm@klankschap.nl>:
> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [question] \clipping some data from a pdf
  2020-01-29  6:04 ` Henning Hraban Ramm
@ 2020-01-30 13:55   ` Aditya Mahajan
  0 siblings, 0 replies; 3+ messages in thread
From: Aditya Mahajan @ 2020-01-30 13:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 29 Jan 2020, Henning Hraban Ramm wrote:

>
>> Am 2020-01-29 um 00:27 schrieb Floris van Manen <vm@klankschap.nl>:
>> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-30 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28 23:27 [question] \clipping some data from a pdf Floris van Manen
2020-01-29  6:04 ` Henning Hraban Ramm
2020-01-30 13:55   ` Aditya Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).