From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31244 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Johan Bergquist Newsgroups: gmane.text.pandoc Subject: Re: Strategies for image management for docx and html output? Date: Thu, 18 Aug 2022 03:03:32 -0700 (PDT) Message-ID: <94c2ac4c-9a15-4153-a6b4-3a6560ead27bn@googlegroups.com> References: <1db7b650-0b44-4eb4-84bf-bdf6a3fd9dd6n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1780_1767395176.1660817012768" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15660"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDWY3LNK6YFBB5U47CLQMGQE27HQQGQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Aug 18 12:03:40 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-yw1-f188.google.com ([209.85.128.188]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oOcNG-0003p4-L7 for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 18 Aug 2022 12:03:38 +0200 Original-Received: by mail-yw1-f188.google.com with SMTP id 00721157ae682-334f49979a0sf19703227b3.10 for ; Thu, 18 Aug 2022 03:03:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc; bh=Cj+QjFOpRnreRk+yzJSCcjHlcEME42tY+qGddXGNMPw=; b=D3fNAT+uNFErsHsQknjuJqyilZxEmKEJk1tNPU3nitMNeC8mMa+X9Sbi0iVt0vAk2w hoNvP/aGaDXTgRpRrmNGpq/w7iCqlieupdS97ucmGnuvARKFd0B3avYPVb0oZ2kC9Deo V0bRbo4e5NxTVFTRWoFYDgf53aAa+FBvClZFTUvX/ZzVJDr8YGxdBU+y8JFek3Td7afi 8cfLZ/cKMmJGFvjj/r2Sp16eCdqoXY2G8IuoVUAji8eDvwmfNJOcm+tXrr5gaoCQ2GDm +8RR0m7Ihmai4uOMLeYBijCdqN75v4TPZCMLeApx9KFZ2Go785vlGzjQgoFF8bqehRkd 2kag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=den-se.20210112.gappssmtp.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc; bh=Cj+QjFOpRnreRk+yzJSCcjHlcEME42tY+qGddXGNMPw=; b=PcVr+iPlUjS/uQWVvpxn8PUVp89PCsmJ7kVFhPeDPdjkD4C8CdYkdvlfd1vvmjP1YO 1GHsYOLq+L76lbel8Tce9xjrci/ROVmSKX6xVw94E+InzbI4HAUMTAOjuSfLgBm5ZYOy juA/W2i6ZHmQ0zYIaHZ8LWtWrE1XoCxW+uKJ/oHfGmR7IDwnKWcR4jVy4d2WfHW68IcP OLwI9LHFMSK2xGsfL4Fe8kgQ7fcSycJDosmtUByDFZmax19up04VSa2Nb+MAZuFERyvd HlUAZIFDwNvUoiPNTPg5lgQPSL9tpTv0H6+IkvCp5vPxPP6PE6hHVhstDa8MaHB+BqDC wZ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc; bh=Cj+QjFOpRnreRk+yzJSCcjHlcEME42tY+qGddXGNMPw=; b=jxSWJRwYdwE3hdcjMexVR34kau/NpCHwwuK5o5z39WD4nHkktJYWew2TZ58tC4DIB8 qo4K2ApxeK6MW67y2Xx/FRcuGCdamzovYGOyuYtZWYXocTkQJmt6uBZVEN4z2VeJ1AyD L8PdWD6M70Pg/f4hsFQ4pxfGBBWZ6XvK9oRiMhRsvB3u7KRfOmdmtK1OUl/8lZ9cKPc/ 823EZc9m94f0LQFUAAdgVXHHdKCE1B1pxpE3J16UXBSK2joqzmTpc8EfxotQQ3N7PeBe TpteXA1hVIhjwdSsUlOGnC5M9lZX9gq6DjZoJ/ocRlE/kJZF7GHIOux4sDeErVrDbBS3 /ydg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACgBeo06cv9EU55xxCY+j5zfNvKbGae7d3teXFvzUWOJdQIyIoodl6Kc Pfnfxm/wc32DHg8j7G2ihgk= X-Google-Smtp-Source: AA6agR6e/AUDYmyuIJjccALZkOUPkoSLCznUg+NA/Z1htRSOnlDZxlwYZt5wLS22IP4kXa9vBV3hKw== X-Received: by 2002:a5b:f4b:0:b0:67a:6ac9:438b with SMTP id y11-20020a5b0f4b000000b0067a6ac9438bmr2030997ybr.595.1660817017424; Thu, 18 Aug 2022 03:03:37 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a25:b11e:0:b0:67c:3fe6:16c4 with SMTP id g30-20020a25b11e000000b0067c3fe616c4ls793051ybj.4.-pod-prod-gmail; Thu, 18 Aug 2022 03:03:33 -0700 (PDT) X-Received: by 2002:a25:f80c:0:b0:691:7d23:74c9 with SMTP id u12-20020a25f80c000000b006917d2374c9mr2139273ybd.112.1660817013654; Thu, 18 Aug 2022 03:03:33 -0700 (PDT) In-Reply-To: <1db7b650-0b44-4eb4-84bf-bdf6a3fd9dd6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: johan-+Ii6mvK/KIU@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:31244 Archived-At: ------=_Part_1780_1767395176.1660817012768 Content-Type: multipart/alternative; boundary="----=_Part_1781_1859685256.1660817012768" ------=_Part_1781_1859685256.1660817012768 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable My workflow is authoring in Word and exporting to PDF (for printing and=20 download) and HTML (for online publishing). Because of the printing=20 resolution requirements, I need to use scalable vector graphics (SVG) as=20 Word doesn't support EPS. While exporting to PDF is done directly with=20 Acrobat, I'm using pandoc 2.18 to convert docx to html and the output image= =20 size is consistent with the original, even after scaling in Word. The size= =20 shows up as attributes such as "style=3D"width:0.5in;height:0.5in".= =20 However, I haven't found any way to export the SVG images as is without=20 renaming and converting to PNG. I tried to link the images instead of=20 embedding them in Word but the files are still PNG and the naming=20 (imageN.png) persists. For one particular document, the counter N starts at= =20 N=3D4 and after N=3D5 only even numbers are used. I first thought that this= is=20 due to the image in the Word header (not converted) but there are only two= =20 pages before the first body image so it should start at N=3D3, not N=3D4. T= hen=20 there is one header between the first and second body image so N=3D6 for th= e=20 second makes sense. However, body images 3-13 are all in one chunk (inline)= =20 on the same page so I don't understand why only even numbers are used. My= =20 current workaround is to name the original files imageN.svg and then do a= =20 global ".png" to ".svg" search-replace in the html file. This works but the= =20 file names aren't very descriptive. I'm a relatively new user of pandoc so= =20 I haven't filed any bugs yet - is github the place to file? On Wednesday, 14 July 2021 at 02:40:54 UTC+9 Andrew Voelkel wrote: > I had sworn that I had tried the image attributes and did not see it=20 > reflected in the docx output, but apparently I made some sort of mistake,= =20 > because now it is working! Thank you. > > Now, if I can just figure out how to get the markdown preview renderer in= =20 > VSCode or MacDown to work properly with the width specifier. But that is = a=20 > "nice to have", not a requirement. > > Thanks again.=20 > On Monday, July 12, 2021 at 11:18:29 PM UTC-7 BPJ wrote: > >> Have you read the manual section on link/image attributes? You can set= =20 >> explicit width and height attributes on images. >> >> https://pandoc.org/MANUAL.html#extension-link_attributes >> >> However DOCX has specific problems with TIFF, perhaps also with other=20 >> formats? >> >> https://github.com/jgm/pandoc/issues/7405 >> >> (Apparently this will be fixed in the next release.) >> >> >> Den m=C3=A5n 12 juli 2021 19:43Andrew Voelkel sk= rev: >> >>> Help! I've been messing around for hours and I still can't figure out a= =20 >>> viable strategy for dealing with images in pandoc documents. The "must= =20 >>> have" for this project is to be able to get good docx output for the=20 >>> images, and be able to have control over the size of the images in the= =20 >>> docx.=20 >>> >>> So far, the only satisfactory results I've gotten are from content=20 >>> originating in my drawing program (Omnigraffle), and saved in PDF forma= t,=20 >>> then inserted into the docx (via markdown, of course). In this case, th= e=20 >>> original size of the graphic is respected. However, when I try to use p= ngs=20 >>> which I've inherited, Word seems to want to resize them to hit both lef= t=20 >>> and right margins, regardless of their original size. I haven't figured= out=20 >>> a way around this. This is true even if I import the png into the drawi= ng=20 >>> program and export as PDF. >>> >>> So, first question - is there a way to indicate the image size in the= =20 >>> markdown such that the docx output will reflect that setting? >>> >>> In addition to the "must have" of good docx output, it would be nice to= =20 >>> have the html output of the markdown also display the images properly w= hen=20 >>> composing the document in markdown. I've noticed that depending on the= =20 >>> renderer, the {width=3D400px} directive will sometimes be respected in = the=20 >>> output. But there are two problems. >>> >>> First, it doesn't seem that importing PDFs works when rendering markdow= n=20 >>> to html. So the PDFs which are the only solution for docx don't work in= =20 >>> this situation.=20 >>> >>> Second, it would seem that I'd need to have and "ifdef" type of=20 >>> functionality in the markdown, so that the image sizing directive could= =20 >>> depend on whether I'm previewing html or telling pandoc to size the ima= ge=20 >>> for Word. I don't know of any such thing. >>> >>> What are other folks doing to deal with these issues? They hardly seem= =20 >>> exotic. If I could get raster graphics to size properly for both html a= nd=20 >>> docx output, I could just save all my graphics as raster graphics, with= a=20 >>> high DPI value so that the scaling should look OK. But I can't seem to = get=20 >>> there from here.=20 >>> >>> Any help or pointers to in depth information about related subjects=20 >>> would be highly appreciated!! >>> >>> --=20 >>> You received this message because you are subscribed to the Google=20 >>> Groups "pandoc-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send= =20 >>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit=20 >>> https://groups.google.com/d/msgid/pandoc-discuss/c708a157-059e-4dc2-a56= 2-797aa11ae620n%40googlegroups.com=20 >>> >>> . >>> >> --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/94c2ac4c-9a15-4153-a6b4-3a6560ead27bn%40googlegroups.com. ------=_Part_1781_1859685256.1660817012768 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable My workflow is authoring in Word and exporting to PDF (for printing and dow= nload) and HTML (for online publishing). Because of the printing resolution= requirements, I need to use scalable vector graphics (SVG) as Word doesn't= support EPS. While exporting to PDF is done directly with Acrobat, I'm usi= ng pandoc 2.18 to convert docx to html and the output image size is consist= ent with the original, even after scaling in Word. The size shows up as <= ;img> attributes such as "style=3D"width:0.5in;height:0.5in". However, I= haven't found any way to export the SVG images as is without renaming and = converting to PNG. I tried to link the images instead of embedding them in = Word but the files are still PNG and the naming (imageN.png) persists. For = one particular document, the counter N starts at N=3D4 and after N=3D5 only= even numbers are used. I first thought that this is due to the image in th= e Word header (not converted) but there are only two pages before the first= body image so it should start at N=3D3, not N=3D4. Then there is one heade= r between the first and second body image so N=3D6 for the second makes sen= se. However, body images 3-13 are all in one chunk (inline) on the same pag= e so I don't understand why only even numbers are used. My current workarou= nd is to name the original files imageN.svg and then do a global ".png" to = ".svg" search-replace in the html file. This works but the file names aren'= t very descriptive. I'm a relatively new user of pandoc so I haven't filed = any bugs yet - is github the place to file?

On Wednesday, 14 July 2021 at 02:= 40:54 UTC+9 Andrew Voelkel wrote:
I had sworn that I had tried the image attributes and = did not see it reflected in the docx output, but apparently I made some sor= t of mistake, because now it is working! Thank you.

Now,= if I can just figure out how to get the markdown preview renderer in VSCod= e or MacDown to work properly with the width specifier. But that is a "= ;nice to have", not a requirement.

Thanks aga= in.=C2=A0
On Monday, July 12, 2021 at 11:18:29 PM UTC-7 BPJ wrote:
Have yo= u read the manual section on link/image attributes? You can set explicit wi= dth and height attributes on images.


However = DOCX has specific problems with TIFF, perhaps also with other formats?


(Apparently thi= s will be fixed in the next release.)


Den m=C3=A5n 12 juli 2021 19:43Andrew Voe= lkel <jandyman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
=

Help! I've been messing around for hours and= I still can't figure out a viable strategy for dealing with images in = pandoc documents. The "must have" for this project is to be able = to get good docx output for the images, and be able to have control over th= e size of the images in the docx.=C2=A0

So far, the only satisfactory results I've gotten are from content o= riginating in my drawing program (Omnigraffle), and saved in PDF format, th= en inserted into the docx (via markdown, of course). In this case, the orig= inal size of the graphic is respected. However, when I try to use pngs whic= h I've inherited, Word seems to want to resize them to hit both left an= d right margins, regardless of their original size. I haven't figured o= ut a way around this. This is true even if I import the png into the drawin= g program and export as PDF.

So, first question - is there a way to i= ndicate the image size in the markdown such that the docx output will refle= ct that setting?

In addition to the "must have" of good doc= x output, it would be nice to have the html output of the markdown also dis= play the images properly when composing the document in markdown. I've = noticed that depending on the renderer, the {width=3D400px} directive will = sometimes be respected in the output. But there are two problems.

Fir= st, it doesn't seem that importing PDFs works when rendering markdown t= o html. So the PDFs which are the only solution for docx don't work in = this situation.=C2=A0

Second, it would seem that I'd need to have= and "ifdef" type of functionality in the markdown, so that the i= mage sizing directive could depend on whether I'm previewing html or te= lling pandoc to size the image for Word. I don't know of any such thing= .

What are other folks doing to deal with these issues? They hardly s= eem exotic. If I could get raster graphics to size properly for both html a= nd docx output, I could just save all my graphics as raster graphics, with = a high DPI value so that the scaling should look OK. But I can't seem t= o get there from here.=C2=A0

Any help or pointers to in depth informa= tion about related subjects would be highly appreciated!!

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pandoc-discus= s/c708a157-059e-4dc2-a562-797aa11ae620n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/94c2ac4c-9a15-4153-a6b4-3a6560ead27bn%40googlegroups.= com.
------=_Part_1781_1859685256.1660817012768-- ------=_Part_1780_1767395176.1660817012768--