* Zooming in to a specific part of the page @ 2010-11-17 0:52 Aditya Mahajan 2010-11-17 1:15 ` Mojca Miklavec 0 siblings, 1 reply; 4+ messages in thread From: Aditya Mahajan @ 2010-11-17 0:52 UTC (permalink / raw) To: mailing list for ConTeXt users Hi, Is it possible to zoom into a specific part of the page? I am thinking of the following scenario. Suppose I have the following document \setuppapersize[S6][S6] \starttext \placefigure[right,none]{\externalfigure[dummy][width=0.3\textwidth]} \input knuth \page \input tufte \stoptext I want that when I click on the image, the pdf is zoomed in so that the image occupies the full screen[1], and when I click on the zoomed in image, it zooms out and I get the previous page view. How do I achieve this? I am guessing that some javascript magic might be needed, but I do not understand the interaction code at all. This feature will be pretty handy for presentations. Thanks Aditya [1]: I do not know if the pdf reader knows the screen size. Assuming that the screen aspect ratio is the same as the page aspect ratio might be a good approximation (at least for presentations). ___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Zooming in to a specific part of the page 2010-11-17 0:52 Zooming in to a specific part of the page Aditya Mahajan @ 2010-11-17 1:15 ` Mojca Miklavec 2010-11-17 1:27 ` Aditya Mahajan 0 siblings, 1 reply; 4+ messages in thread From: Mojca Miklavec @ 2010-11-17 1:15 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Nov 17, 2010 at 01:52, Aditya Mahajan wrote: > Hi, > > Is it possible to zoom into a specific part of the page? I am thinking of > the following scenario. Suppose I have the following document > > \setuppapersize[S6][S6] > \starttext > \placefigure[right,none]{\externalfigure[dummy][width=0.3\textwidth]} > \input knuth > > \page > > \input tufte > > \stoptext > > I want that when I click on the image, the pdf is zoomed in so that the > image occupies the full screen[1], and when I click on the zoomed in image, > it zooms out and I get the previous page view. > > How do I achieve this? I am guessing that some javascript magic might be > needed, but I do not understand the interaction code at all. This feature > will be pretty handy for presentations. You don't need JavaScript. You can use a normal hyperlink: [page /FitR left bottom right top] Display the page designated by page, with its contents magnified just enough to fit the rectangle specified by the coordinates left, bottom, right, and top entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the rectangle within the window in the other dimension. https://www.adobe.com/devnet/pdf/pdf_reference_archive.html Section "8.2.1 Destinations" of PDFReference16.pdf You only need to find a way to transfer the data from nice interface in ConTeXt into PDF literals. Mojca PS: in case that you start hacking with that, please also convince Hans to fix hyperlinks in formulas/chapters/tables/... (see equation \in[eq:formulalabel]) to point to specific location on some page, not to the whole page. ___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Zooming in to a specific part of the page 2010-11-17 1:15 ` Mojca Miklavec @ 2010-11-17 1:27 ` Aditya Mahajan 2010-11-17 18:36 ` Hans Hagen 0 siblings, 1 reply; 4+ messages in thread From: Aditya Mahajan @ 2010-11-17 1:27 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, 17 Nov 2010, Mojca Miklavec wrote: > On Wed, Nov 17, 2010 at 01:52, Aditya Mahajan wrote: >> Hi, >> >> Is it possible to zoom into a specific part of the page? I am thinking of >> the following scenario. Suppose I have the following document >> >> \setuppapersize[S6][S6] >> \starttext >> \placefigure[right,none]{\externalfigure[dummy][width=0.3\textwidth]} >> \input knuth >> >> \page >> >> \input tufte >> >> \stoptext >> >> I want that when I click on the image, the pdf is zoomed in so that the >> image occupies the full screen[1], and when I click on the zoomed in image, >> it zooms out and I get the previous page view. >> >> How do I achieve this? I am guessing that some javascript magic might be >> needed, but I do not understand the interaction code at all. This feature >> will be pretty handy for presentations. > > You don't need JavaScript. You can use a normal hyperlink: > > [page /FitR left bottom right top] I hope that I do not have to write raw PDF literals. > Display the page designated by page, with its contents magnified just > enough to fit the rectangle specified by the coordinates left, bottom, > right, and top entirely within the window both horizontally and > vertically. If the required horizontal and vertical magnification > factors are different, use the smaller of the two, centering the > rectangle within the window in the other dimension. > > https://www.adobe.com/devnet/pdf/pdf_reference_archive.html > Section "8.2.1 Destinations" of PDFReference16.pdf Thanks. > You only need to find a way to transfer the data from nice interface > in ConTeXt into PDF literals. I don't know if this data is available when a figure is being placed. At the very least, I need to know the xy location of one of the corners of the figure (and can compute other corners based on height and width) > PS: in case that you start hacking with that, please also convince > Hans to fix hyperlinks in formulas/chapters/tables/... (see equation > \in[eq:formulalabel]) to point to specific location on some page, not > to the whole page. I thought that you were the most persuasive person :) This has been around for a while. Maybe we should open a tracker item for it. 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Zooming in to a specific part of the page 2010-11-17 1:27 ` Aditya Mahajan @ 2010-11-17 18:36 ` Hans Hagen 0 siblings, 0 replies; 4+ messages in thread From: Hans Hagen @ 2010-11-17 18:36 UTC (permalink / raw) To: mailing list for ConTeXt users On 17-11-2010 2:27, Aditya Mahajan wrote: >> PS: in case that you start hacking with that, please also convince >> Hans to fix hyperlinks in formulas/chapters/tables/... (see equation >> \in[eq:formulalabel]) to point to specific location on some page, not >> to the whole page. > > I thought that you were the most persuasive person :) This has been > around for a while. Maybe we should open a tracker item for it. For some constructs \setupinteraction[state=start,focus=width] will do the job for chapter titles and some more. For others it's work in progress. The current setting is carried with the hyperlink so it's mostly a matter of dealing with it. That kind of functionality probably has to be configured on a per construct basis (with variants concerning what is the width/height of that construct in order to avoid too jumpy behaviour). I don't like to hack something that later has to be changed. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-17 18:36 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-11-17 0:52 Zooming in to a specific part of the page Aditya Mahajan 2010-11-17 1:15 ` Mojca Miklavec 2010-11-17 1:27 ` Aditya Mahajan 2010-11-17 18:36 ` Hans Hagen
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).