From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/90691 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: export images Date: Sat, 21 Mar 2015 13:11:24 +0100 Message-ID: <04FCFE0C-9E85-4D0F-92AE-60AED90146B4@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/mixed; boundary="===============1395789074==" X-Trace: ger.gmane.org 1426939938 19141 80.91.229.3 (21 Mar 2015 12:12:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2015 12:12:18 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 21 13:12:06 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YZIG2-0001Az-A6 for gctc-ntg-context-518@m.gmane.org; Sat, 21 Mar 2015 13:12:02 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 65A11101F9 for ; Sat, 21 Mar 2015 13:12:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Lb2pMQjWAC1A for ; Sat, 21 Mar 2015 13:12:00 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 20E041022F for ; Sat, 21 Mar 2015 13:11:33 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C4273101F9 for ; Sat, 21 Mar 2015 13:11:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id RyqHHELMmfaT for ; Sat, 21 Mar 2015 13:11:28 +0100 (CET) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id E63EC101E8 for ; Sat, 21 Mar 2015 13:11:28 +0100 (CET) Original-Received: from mail-we0-x230.google.com (mail-we0-x230.google.com [IPv6:2a00:1450:400c:c03::230]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t2LCBRvI003932 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sat, 21 Mar 2015 13:11:28 +0100 Original-Received: by wegp1 with SMTP id p1so101317169weg.1 for ; Sat, 21 Mar 2015 05:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=FkCBg7K+dIvhDjlx2n5VbFXvUCG7WPC+s4jAShl2DVI=; b=XaVDZ3y8cj2pJDpysP+Cj8ty4h5C7XCnX4OPQN54nlXkxm97lBJ/Aw3yap+cUU/1Ei eGtm6pgSd9sC7OzN1dQ6kt8S+yNZLar3m0oSQekDBOZnLWya14yYCbtFBgVdPNIGgxUa kvZ0BmxxXWj+qFdHkUbjU9YEIZX1DR1Gd07hO3absLAdzBgDoDYbx6k6eyKSywCYy6+U pWs+IE+I8aOMdI5Uip1/RNHHsQNvLwzLWO4LVFtvBxWSytKtA74Q898Y02YzZv+0ySsH b3RX1Savib9pczLI9IDZmH5SHaw4xO5zYmOJQwbPzW+ePXX9F0AYrEs02IMfDi67BKbu u2rQ== X-Received: by 10.180.82.135 with SMTP id i7mr3924104wiy.78.1426939887655; Sat, 21 Mar 2015 05:11:27 -0700 (PDT) Original-Received: from keima.localdomain (x2f23f15.dyn.telefonica.de. [2.242.63.21]) by mx.google.com with ESMTPSA id nb4sm10381029wjc.20.2015.03.21.05.11.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Mar 2015 05:11:26 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.2070.6) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c03::230; country=IE; latitude=53.3478; longitude=-6.2597; http://maps.google.com/maps?q=53.3478,-6.2597&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07O6cbsXQ - 928bb5b016c7 - 20150321 (trained as not-spam) Received-SPF: pass (filter1-utr.mf.surf.net: domain of schuster.wolfgang@gmail.com designates 2a00:1450:400c:c03::230 as permitted sender) receiver=filter1-utr.mf.surf.net; client-ip=2a00:1450:400c:c03::230; envelope-from=; helo=mail-we0-x230.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" X-Spam-Report: 5.0 points; * 3.2 RCVD_ILLEGAL_IP Received: contains illegal IP address * 0.0 HTML_MESSAGE BODY: HTML included in message * 1.8 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars Xref: news.gmane.org gmane.comp.tex.context:90691 Archived-At: --===============1395789074== Content-Type: multipart/alternative; boundary="Apple-Mail=_B1E81512-7F11-45E8-A0C0-79A163AEEADB" --Apple-Mail=_B1E81512-7F11-45E8-A0C0-79A163AEEADB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Am 21.03.2015 um 12:01 schrieb Idris Samawi Hamid =D8=A7=D8=AF=D8=B1=D9=8A= =D8=B3 =D8=B3=D9=85=D8=A7=D9=88=D9=8A =D8=AD=D8=A7=D9=85=D8=AF = : >=20 > On Sat, 21 Mar 2015 02:55:08 -0600, Wolfgang Schuster = > = wrote: >=20 >>=20 >>> Am 21.03.2015 um 03:09 schrieb Idris Samawi Hamid =D8=A7=D8=AF=D8=B1=D9= =8A=D8=B3 =D8=B3=D9=85=D8=A7=D9=88=D9=8A =D8=AD=D8=A7=D9=85=D8=AF = : >>>=20 >>> Dear gang, >>>=20 >>> How do we get images in the export? Here is my sample (also = attached): >>>=20 >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> \setupbackend[export=3Dyes] >>>=20 >>> \starttext >>> \startalignment [middle] >>> \dontleavehmode >>> \externalfigure[mill.png] >>> \stopalignment >>> \stoptext >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>=20 >>> div output: >>>=20 >>> =3D=3D >>>
>>>
>>>
>>> =3D=3D >>>=20 >>> So it seems that \externalfigure[mill.png] is tagged in the output = but the >>> image itself is ignored. What am I missing here? pdf output is = correct; I >>> copied mill.png from the context sample folder >>>=20 >>> /tex/texmf-context/tex/context/sample/mill.png >>=20 >> Put mill.png in the images folder which should exist in the export = folder. >=20 > Thanks, Wolfgang! >=20 > One more question on this: How can I setup the images so that I don't = have to toggle, e.g. >=20 > \externalfigure[basmalah.png][width=3D3in] > % \externalfigure[basmalah.pdf][width=3D3in] >=20 > Is there a way to tell the export to use the png option, while telling = the pdf output to use the pdf? This is important when the image is made = from a font (no needs scalability in the pdf). You can try to use the *export mode to use different images for the XML = and PDF output. The first method is to drop the file extension and tell context to use = the PNG files when the export is enabled. %\setupbackend[export=3Dyes] % uncomment to enable *export mode \startmode[*export] \useexternalfigure[basmalah] [basmalah.png] \stopmode % possible but not necessary because ConTeXt prefers images in the PDF = format % % \startnotmode[*export] % \useexternalfigure[basmalah] [basmalah.pdf] % \stopnotmode \starttext \externalfigure[basmalah] \stoptext The second method is to specify which image should be used when the = export is disabled/enabled. %\setupbackend[export=3Dyes] % uncomment to enable *export mode \starttext \doifmodeelse{*export} {\externalfigure[basmalah.png]} {\externalfigure[basmalah.pdf]} \stoptext The third method is to use two folders for the images in PDF and PNG = format. %\setupbackend[export=3Dyes] % uncomment to enable *export mode \doifmodeelse[*export] {\setupexternalfigures[directory=3Dpngimages]} {\setupexternalfigures[directory=3Dpdfimages]} \starttext \externalfigure[basmalah] \stoptext Wolfgang= --Apple-Mail=_B1E81512-7F11-45E8-A0C0-79A163AEEADB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Am 21.03.2015 um 12:01 schrieb Idris Samawi Hamid =D8=A7=D8=AF=D8= =B1=D9=8A=D8=B3 =D8=B3=D9=85=D8=A7=D9=88=D9=8A =D8=AD=D8=A7=D9=85=D8=AF = <ishamid@colostate.edu>:

On Sat, 21 Mar 2015 02:55:08 -0600, Wolfgang = Schuster <schuster.wolfgang@gmail.com> wrote:


Am 21.03.2015 um 03:09 = schrieb Idris Samawi Hamid =D8=A7=D8=AF=D8=B1=D9=8A=D8=B3 =D8=B3=D9=85=D8=A7= =D9=88=D9=8A =D8=AD=D8=A7=D9=85=D8=AF <ishamid@colostate.edu>:

Dear gang,

How do we get images = in the export? Here is my sample (also attached):

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
\setupbackend[export=3Dyes]

\starttext
\startalignment [middle]
\dontleavehmode
\externalfigure[mill.png]
\stopalignment
\stoptext
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

div output:

=3D=3D
<div>
 <div class=3D"image" = id=3D"image-1"><!--empty--></div>
</div>
=3D=3D

So it seems that \externalfigure[mill.png] is tagged in the = output but the
image itself is ignored. What am I missing = here? pdf output is correct; I
copied mill.png from the = context sample folder

/tex/texmf-context/tex/context/sample/mill.png

Put mill.png in the images folder = which should exist in the export folder.

Thanks, Wolfgang!

One more question on this: How can I setup the = images so that I don't have to toggle, e.g.

\externalfigure[basmalah.png][width=3D3in]<= br style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; = font-variant: normal; font-weight: normal; letter-spacing: normal; = line-height: normal; orphans: auto; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; widows: auto; word-spacing: = 0px; -webkit-text-stroke-width: 0px;" class=3D"">% = \externalfigure[basmalah.pdf][width=3D3in]

Is there a way to tell the export to use the png = option, while telling the pdf output to use the pdf? This is important = when the image is made from a font (no needs scalability in the = pdf).

You = can try to use the *export mode to use different images for the XML and = PDF output.


The first method is to drop the file = extension and tell context to use the PNG files when the export is = enabled.

%\setupbackend[export=3Dyes] % uncomment to enable *export = mode

\startmode[*export]
  = \useexternalfigure[basmalah] [basmalah.png]
\stopmode

% possible but not necessary because ConTeXt prefers images = in the PDF format
%
% = \startnotmode[*export]
%   = \useexternalfigure[basmalah] [basmalah.pdf]
% = \stopnotmode

\starttext
\externalfigure[basmalah]
\stoptext


The second method is to = specify which image should be used when the export is = disabled/enabled.

%\setupbackend[export=3Dyes] % uncomment to = enable *export mode

\starttext

\doifmodeelse{*export}
  = {\externalfigure[basmalah.png]}
  = {\externalfigure[basmalah.pdf]}

\stoptext


The = third method is to use two folders for the images in PDF and PNG = format.

%\setupbackend[export=3Dyes] % uncomment to enable *export = mode

\doifmodeelse[*export]
  = {\setupexternalfigures[directory=3Dpngimages]}
 = {\setupexternalfigures[directory=3Dpdfimages]}

\starttext
\externalfigure[basmalah]
\stoptext


Wolfgang
= --Apple-Mail=_B1E81512-7F11-45E8-A0C0-79A163AEEADB-- --===============1395789074== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1395789074==--