From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Matthias Weber <matweber@indiana.edu>
Subject: Re: Was: Opening external documents ... -> Can ConTeXt reduce size of images?
Date: Tue, 08 Jan 2013 02:09:09 +0100 [thread overview]
Message-ID: <50EB71B5.9030803@wxs.nl> (raw)
In-Reply-To: <46570E6F-7F3F-4D8A-81C2-DFFA1203431C@indiana.edu>
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
___________________________________________________________________________________
next prev parent reply other threads:[~2013-01-08 1:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 18:45 Opening external documents with external application Matthias Weber
2013-01-07 20:52 ` Wolfgang Schuster
2013-01-08 0:00 ` Was: Opening external documents ... -> Can ConTeXt reduce size of images? Matthias Weber
2013-01-08 1:09 ` Hans Hagen [this message]
2013-01-08 23:04 ` Matthias Weber
2013-01-08 23:30 ` Hans Hagen
2013-01-09 0:17 ` Marco Patzer
2013-01-08 23:34 ` Martin Schröder
2013-01-09 0:56 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50EB71B5.9030803@wxs.nl \
--to=pragma@wxs.nl \
--cc=matweber@indiana.edu \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).