[texworks] SCRIPTING: get current poppler page number

Paul A Norman paul.a.norman at gmail.com
Thu Oct 21 04:40:20 CEST 2010



  "When opening a PDF document with an Apple Event on a Macintosh
operating system,
  you can optionally pass the PDF Open parameters."

What does this mean to a Mac user please? - i.e. what is an "Apple Event"

I tried to search for this  but all I got so far was the kind of Steve
Jobs - Apple Event that Donald Knuth was having fun about in his iTex
{ding-a-ling} talk at TUG this year. :)


Mixing things up I have found that the following kinds of things can
be done on the command line in  Win32 (and so TwApi.system() ), and if
acrobat reader 32 is being used, should work on Win64 as well, but I
can not check.  As outlined Apple Events are able to reproduce the
following as well according to:

This process is very fast (much faster than pdfopen on Xp under
MiKTex). I need to check for more switches like /A as otherwise we
need to close and rerun to get a different page number.
 - but it is fast.  The utility start is required as modern acrobat
reader does not appear to be on the path, and it can look up acrord32.

     start acrord32 /A "page=17" "D:\LaTeXPortable\LatexUtils\General

     start acrord32 /A "page=41&toolbar=0&pagemode=thumbs"

     start acrord32 /A "page=41&toolbar=0&pagemode=bookmarks&zoom=71"
ls\General Files\blahblah.pdf"


Is there a general Linux equivalent bash script to windows acrod32 for
starting an installed acrobat reader  please? Or is this going to be
distro by distro? I think on a number of distros  Evince is going to
try and step in otherwise, and it does not appear to handle the extra
pdf features that this is all about.

Or could I hope to rely on "pdfopen" to be present on genreal Linux
distors of TexLive? If so can I just call it directly and pass its
parametrers to it?


Another option

Tw tries to autodetect acrobat reader and/or User sets up a
prepferences option saying where their installed (and how to call)
acroread is, and TwScript be able to read it.


On 21 October 2010 11:54, Paul A Norman <paul.a.norman at gmail.com> wrote:
> Ok, I think I'll keep at this.
> Will look around the issue from a different tack.
> Menawhile line 15 will need changing to work the Script form the
> preview Script menu
>  if ((thisDestination != "")& (thisDestination != undefined)) //
> undefiined for when opening from poppler preview
> And OS checking to only have "cmd /c" for windows versions (line 35)
> I'll repost when there is someting more useful at hand.
> Appreciate any suggestions - insights please.
> Paul
> On 21 October 2010 10:33, Matthias Pospiech <matthias.pospiech at gmx.de> wrote:
>> Am 20.10.2010 23:22, schrieb Reinhard Kotucha:
>>> However, the implementation of these programs seems to be completely
>>> different on Windows.  There isn't even a fork() system call and the
>>> Windows version is using DDE for inter process communication while, as
>>> far as I understand, the Unix version uses X11 facilities.
>> If it uses the DDE commands that Texniccenter had implemented for ages these
>> work only
>> for the professional series not the free acrobat reader. Maybe that has
>> changed for V9
>> but DDE is not really reliable since all versions of acrobat differ.
>> Note that I am not an export on the DDE use of acrobat, this is only what I
>> learned by using it.
>> Matthias

More information about the texworks mailing list