Opening external documents with external application
Dear All, I used to write \goto{\externalfigure[cuteimage]}[program(file.ext)] to get an image, that, when clicked, will open an application that will open file.ext. This currently still works on my Mac (10.8) with the TeXShop preview and with Skim. I does not work anymore with Adobe Acrobat Reader. Acrobat now asks permission, but doesn't do anything when granted. Even worse, on another Mac with an older OS, Skim didn't open the hyperlink either. On Windows, I couldn't find any program that would do the job, by I don't know much about that part of the world. Is there anything that has changed recently in the way these kind of hyperlinks must be written? (I use MkII) Thanks, Matthias
Am 07.01.2013 um 19:45 schrieb Matthias Weber
Dear All,
I used to write
\goto{\externalfigure[cuteimage]}[program(file.ext)]
to get an image, that, when clicked, will open an application that will open file.ext.
This currently still works on my Mac (10.8) with the TeXShop preview and with Skim. I does not work anymore with Adobe Acrobat Reader. Acrobat now asks permission, but doesn't do anything when granted. Even worse, on another Mac with an older OS, Skim didn't open the hyperlink either. On Windows, I couldn't find any program that would do the job, by I don't know much about that part of the world.
Is there anything that has changed recently in the way these kind of hyperlinks must be written? (I use MkII)
Your chance to get an answer will increase with a *working* minimal example. Wolfgang
Thanks Wolfgang -
I believed that the question was easy enough as is, but that was of course short sighted.
The problem I described does not arise when one just typesets the file, everything is good.
What I did was to reduce its file size using OS X's preview. This has apparently been "improved"
so that it changes the behavior wrt external links.
In case somebody wants to try:
Typeset
\setupinteraction[page=yes,state=start]
\starttext
\goto{click}[program(test.tex)]
\stoptext
Open test.pdf with Acrobat. Clicking on "click" opens test.tex with your designated TeX editor.
Close file in Acrobat.
Open test.pdf in Preview (OS 10.8, I am sure it behaved differently in earlier versions).
Export with "reduce file size" as option checked
Open exported file in Acrobat.
Clicking on "click" will try to access the absolute file path of the previously relative link. In the best case,
the finder will point to that file (instead of opening it). In the worst case, it will not be found.
So, this clearly is not a ConTeXt problem. But it causes me major headaches. In my workflow, I have dozens of images
that I prepare with Adobe Illustrator and save as pdf files that are still editable with Illustrator, i.e. that include another copy of the
file with layers etc. In other words, my pdf images are about 10 times as big as they need to be. I usually just reduce the file size with preview.
As this seems to be erroneous now, I am wondering:
Is there an option in \externalfigure that will strip everything redundant from a pdf file?
Thanks again,
Matthias
On Jan 7, 2013, at 3:52 PM, Wolfgang Schuster
Am 07.01.2013 um 19:45 schrieb Matthias Weber
: Dear All,
I used to write
\goto{\externalfigure[cuteimage]}[program(file.ext)]
to get an image, that, when clicked, will open an application that will open file.ext.
This currently still works on my Mac (10.8) with the TeXShop preview and with Skim. I does not work anymore with Adobe Acrobat Reader. Acrobat now asks permission, but doesn't do anything when granted. Even worse, on another Mac with an older OS, Skim didn't open the hyperlink either. On Windows, I couldn't find any program that would do the job, by I don't know much about that part of the world.
Is there anything that has changed recently in the way these kind of hyperlinks must be written? (I use MkII)
Your chance to get an answer will increase with a *working* minimal example.
Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________
On 1/8/2013 1:00 AM, Matthias Weber wrote:
So, this clearly is not a ConTeXt problem. But it causes me major headaches. In my workflow, I have dozens of images that I prepare with Adobe Illustrator and save as pdf files that are still editable with Illustrator, i.e. that include another copy of the file with layers etc. In other words, my pdf images are about 10 times as big as they need to be. I usually just reduce the file size with preview. As this seems to be erroneous now, I am wondering:
it's even worse ... all kind of color and other data is present is such a file .. the pstopdf.rb script (comes with mkii) gets rid of some of that normally at pragma we do such things either automatically (when graphics are put in repositories) or with acrobat in batch mode (doable if you get the graphics in advance) because doing such thing smanually for thousands of images is no fun you can play with this: \startluacode local gsp = os.type == "windows" and "gswin32c" or "gs" local gsc = "%s -q -dEPSCrop -sDEVICE=pdfwrite -dNOPAUSE -dSAFER -dNOCACHE -dBATCH -dProcessColorModel=/DeviceCMYK -sOutputFile=%s %s -c quit" local pdp = "pdftops -eps %s %s" figures.converters.pdf = { xxx = function(oldname,newname) local tmpname = oldname .. ".ps" local command = string.format(pdp,oldname,tmpname) os.execute(command) local command = string.format(gsc,gsp,newname,oldname) os.execute(command) end } figures.registersuffix("xxx","pdf") \stopluacode \starttext \externalfigure[cow.pdf][conversion=xxx] \stoptext pdftops comes with xpdf (also in minimals) if needed I can add a standard converter for it 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 -----------------------------------------------------------------
Thanks Hans,
I'll give this a try when I am in a daring mood and less busy.
Matthias
On Jan 7, 2013, at 8:09 PM, Hans Hagen
On 1/8/2013 1:00 AM, Matthias Weber wrote:
So, this clearly is not a ConTeXt problem. But it causes me major headaches. In my workflow, I have dozens of images that I prepare with Adobe Illustrator and save as pdf files that are still editable with Illustrator, i.e. that include another copy of the file with layers etc. In other words, my pdf images are about 10 times as big as they need to be. I usually just reduce the file size with preview. As this seems to be erroneous now, I am wondering:
it's even worse ... all kind of color and other data is present is such a file .. the pstopdf.rb script (comes with mkii) gets rid of some of that
normally at pragma we do such things either automatically (when graphics are put in repositories) or with acrobat in batch mode (doable if you get the graphics in advance) because doing such thing smanually for thousands of images is no fun
you can play with this:
\startluacode local gsp = os.type == "windows" and "gswin32c" or "gs" local gsc = "%s -q -dEPSCrop -sDEVICE=pdfwrite -dNOPAUSE -dSAFER -dNOCACHE -dBATCH -dProcessColorModel=/DeviceCMYK -sOutputFile=%s %s -c quit" local pdp = "pdftops -eps %s %s"
figures.converters.pdf = { xxx = function(oldname,newname) local tmpname = oldname .. ".ps" local command = string.format(pdp,oldname,tmpname) os.execute(command) local command = string.format(gsc,gsp,newname,oldname) os.execute(command) end }
figures.registersuffix("xxx","pdf") \stopluacode
\starttext
\externalfigure[cow.pdf][conversion=xxx]
\stoptext
pdftops comes with xpdf (also in minimals)
if needed I can add a standard converter for it
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 ___________________________________________________________________________________
On 1/9/2013 12:04 AM, Matthias Weber wrote:
Thanks Hans,
I'll give this a try when I am in a daring mood and less busy.
the latest beta has this: % \enabletrackers[graphics.programs] \starttext \externalfigure[cow.pdf][conversion=stripped] \stoptext Of course I cannot guarantee that the pdf gets stripped, but at least it's tried.
Matthias
On Jan 7, 2013, at 8:09 PM, Hans Hagen
wrote: On 1/8/2013 1:00 AM, Matthias Weber wrote:
So, this clearly is not a ConTeXt problem. But it causes me major headaches. In my workflow, I have dozens of images that I prepare with Adobe Illustrator and save as pdf files that are still editable with Illustrator, i.e. that include another copy of the file with layers etc. In other words, my pdf images are about 10 times as big as they need to be. I usually just reduce the file size with preview. As this seems to be erroneous now, I am wondering:
it's even worse ... all kind of color and other data is present is such a file .. the pstopdf.rb script (comes with mkii) gets rid of some of that
normally at pragma we do such things either automatically (when graphics are put in repositories) or with acrobat in batch mode (doable if you get the graphics in advance) because doing such thing smanually for thousands of images is no fun
you can play with this:
\startluacode local gsp = os.type == "windows" and "gswin32c" or "gs" local gsc = "%s -q -dEPSCrop -sDEVICE=pdfwrite -dNOPAUSE -dSAFER -dNOCACHE -dBATCH -dProcessColorModel=/DeviceCMYK -sOutputFile=%s %s -c quit" local pdp = "pdftops -eps %s %s"
figures.converters.pdf = { xxx = function(oldname,newname) local tmpname = oldname .. ".ps" local command = string.format(pdp,oldname,tmpname) os.execute(command) local command = string.format(gsc,gsp,newname,oldname) os.execute(command) end }
figures.registersuffix("xxx","pdf") \stopluacode
\starttext
\externalfigure[cow.pdf][conversion=xxx]
\stoptext
pdftops comes with xpdf (also in minimals)
if needed I can add a standard converter for it
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 ___________________________________________________________________________________
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On 2013–01–09 Hans Hagen wrote:
the latest beta has this:
% \enabletrackers[graphics.programs]
\starttext
\externalfigure[cow.pdf][conversion=stripped]
\stoptext
Nice feature, indeed. It might save a preprocessing step. We preprocess with -dProcessDSCComments=false otherwise PDFs generated by external programs (OpenOffice, I'm looking at you) in combination with particular fonts might wreak havoc with the document they are included into. I don't know which downsides this might have, though. In our workflow this leads to more predictable results. Maybe someone with more insight of the PDF internals could judge if it makes sense to add this option. It looks like the presets are not hard-coded. What is the interface to change the presets (screen, ebook, prepress)? Marco
2013/1/8 Hans Hagen
it's even worse ... all kind of color and other data is present is such a file .. the pstopdf.rb script (comes with mkii) gets rid of some of that
We could reduce some of that during pdf inclusion (or use the new build-in pdf library). Best Martin
On 1/9/2013 12:34 AM, Martin Schröder wrote:
2013/1/8 Hans Hagen
: it's even worse ... all kind of color and other data is present is such a file .. the pstopdf.rb script (comes with mkii) gets rid of some of that
We could reduce some of that during pdf inclusion (or use the new build-in pdf library).
the library would then have to tweak a loaded pdf file which is a no-go with respect to mem usage also, some automatic reduction demands a constant adaption of the heuristics best keep away from that and leave it to other programs 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 -----------------------------------------------------------------
participants (5)
-
Hans Hagen
-
Marco Patzer
-
Martin Schröder
-
Matthias Weber
-
Wolfgang Schuster