From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18657 Path: news.gmane.org!.POSTED!not-for-mail From: Kolen Cheung Newsgroups: gmane.text.pandoc Subject: Re: docx to pdf conversion error Date: Mon, 13 Nov 2017 15:37:53 -0800 (PST) Message-ID: <2b1dba89-0544-49a0-954d-cad4c269fc78@googlegroups.com> References: <9256e740-7530-4dc2-9acd-5d14eca6fc07@googlegroups.com> <20171110044412.GI70590@MacBook-Air-2.local> <4710734d-f71c-45c9-b65f-27ebf81e29e1@googlegroups.com> <85643608-a189-4407-8a21-37e5d75074fd@googlegroups.com> <323e407c-d9ae-429a-b951-1dc5b87a624b@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_11683_1026645091.1510616273529" X-Trace: blaine.gmane.org 1510616273 30716 195.159.176.226 (13 Nov 2017 23:37:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Nov 2017 23:37:53 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS252WXTEIBBUWZVDIAKGQEHHHIVKI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Nov 14 00:37:49 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot0-f184.google.com ([74.125.82.184]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEOIW-0007e4-4T for gtp-pandoc-discuss@m.gmane.org; Tue, 14 Nov 2017 00:37:48 +0100 Original-Received: by mail-ot0-f184.google.com with SMTP id s12sf4674772otc.5 for ; Mon, 13 Nov 2017 15:37:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=624Tme3c6G9iJyIA0gmBublcXZZ2H3lQbXANOP53kS4=; b=IkdlKNOmXcHt9gDXXJgAe0AQqzTwgyQTEj3UDFrhK9ZkMtElT/+YLu4Gg/ABB7e0/i dUXfdM2bHl0EC4uM/QYmgqQyEONAmPK9qnPi2acmsL2Xsh5wxBAx5oXkmohzYf1oqg6m U3/JfMo3U9WiW+46crVD1LviKVugadIsQnqwg3NWz2dnXo9JheMjaiW00MIXCHV/Kof7 PfVfpbl9LI/Fwl4dYOevixV9wTfkUQhPniO7wTh6+e5W8YQBg6HVfuHk46y3nwki2V3Q EIStQv67QPxfpi6EA6/kXKPix8X5eQA5rRzYrzhX/l1MPEPDMvOUVvJfJOEUJiRGLh/7 oULA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=624Tme3c6G9iJyIA0gmBublcXZZ2H3lQbXANOP53kS4=; b=TPMr92JYYatOoIQHkAmEwhKk4MoiULldvWsDdBa6IHTK2hRUsV6HISlRGTpA9sQ2Vp 8QHYdDQq1JuJQ1z9mgZfebJqGyjj9bg1DeAYmZVmjGKp6k4Uh6rs5kjdCnbhfDukI4V2 Qgm3/Z1vQUK/GLD3dRxBDN1DrqsrjEh5jFjrWLQ+uvAEYNYZxWB6C6Wip3I7ZYD4/ibg M2k2CiH78mPVYyMcyLTw+DXI+DJinK9JETw3LOaD04Nidttji4k9647Qq0Ufu/DuVCgh SD0DSXkB20jRvmucTMsRIk0EbufdtJBXp+tGOuWqLAMmXknOB1fVsUDn2kDUXMMes7Up vzFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=624Tme3c6G9iJyIA0gmBublcXZZ2H3lQbXANOP53kS4=; b=uUAaLxf2PArTpCve4mz/Ttk3LmlVDkIM2o9btgb5o5zPQTbQEwp3d4UmImLK5RG+Y1 KD52BEOko8SXxbWpgXmsZuSI22In/GC58A+nzC5YLBfqCvikAgBsAQWFahRkUiNTF7Gx 1TdPxVgcj5Vft3b3nIMTI913MVrH0LKMiuY2ANkD6iSVzGXeSwpV6KavQzUeIcFZS3oe gb3jhZB/us3bkuX8Fb2IckmUaRxw2uSKOt0Eza+VMe5AnQ37V2uF8sJ1LywQOrnqLqDr Z6UmZSol4DzQ1lAaLNGw43Pa+Mm3ejy5H0IqhnsAv+lnvb6A00pepf6mTgMwi5uIRIQR Hd+A== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJaThX64oeygw2y36x0fUgVokCSmA7NcQC2tPTjGs4pfKllhi46UhEBz zkEGZsho8hz8i53omCmVqEk= X-Google-Smtp-Source: AGs4zMaZgmyo98d58HzJVoNqxcnVOelJR52F8HvaCcN6Ht3SrbkYRwEspb/EuvymZoUia/FwXl4uVg== X-Received: by 10.157.39.197 with SMTP id c63mr516902otb.11.1510616275346; Mon, 13 Nov 2017 15:37:55 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.52.231 with SMTP id t36ls9958555otd.19.gmail; Mon, 13 Nov 2017 15:37:54 -0800 (PST) X-Received: by 10.157.89.211 with SMTP id u19mr239800otg.14.1510616274154; Mon, 13 Nov 2017 15:37:54 -0800 (PST) In-Reply-To: <323e407c-d9ae-429a-b951-1dc5b87a624b-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: christian.kolen-Re5JQEeQqe8AvxtiuMwx3w@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.org gmane.text.pandoc:18657 Archived-At: ------=_Part_11683_1026645091.1510616273529 Content-Type: multipart/alternative; boundary="----=_Part_11684_1112244562.1510616273529" ------=_Part_11684_1112244562.1510616273529 Content-Type: text/plain; charset="UTF-8" I think you nailed it ;) This is safer and more reliable. May be put it somewhere as an example? (e.g. the lua filter doc.?) On Monday, November 13, 2017 at 1:19:02 AM UTC-8, albert.k...-stqabkCVF6SGlKaCpJGLJw@public.gmane.org wrote: > > Lua filters are my hammer which makes everything look like a nail, so here > is a suggestion on using those to get what you want: > > function Meta(meta) > local f = io.open(meta.metadata_file, 'r') > local content = f:read('*a') > f:close() > return pandoc.read(content).meta > end > > > Safe the above to a file and call pandoc with --lua-filter=.lua > and --metadata=metadata_file:. It will overwrite all > metadata using the contents of the yaml file. > > See also this issue: https://github.com/jgm/pandoc/issues/3115 > > On Sunday, November 12, 2017 at 10:34:02 PM UTC+1, scl...-DpHT0TjK6O80n/F98K4Iww@public.gmane.org > wrote: >> >> Hmm ok - I'll look into that :) >> >> The workflow is probably more edge case from the standard use of pandoc >> for academic writing. >> >> What we want to achieve: >> >> User -> editor of choice -> save in native format >> Apply YAML metadata with user details and extracted customer/client >> details from CRM >> Apply customised style to ensure consistency >> Apply template to ensure consistent cover page, TOC format, >> copyright/confidentiality notice, commercial in confidence footer >> >> Export to PDF for all the good reasons you use PDF for official documents >> ;) >> >> >> > -- 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 email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2b1dba89-0544-49a0-954d-cad4c269fc78%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_11684_1112244562.1510616273529 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think you nailed it ;)

This is safer = and more reliable. May be put it somewhere as an example? (e.g. the lua fil= ter doc.?)

On Monday, November 13, 2017 at 1:19:02 AM UTC-8, albert.= k...-stqabkCVF6SGlKaCpJGLJw@public.gmane.org wrote:
Lua filters are my hammer which makes everything look like a na= il, so here is a suggestion on using those to get what you want:

= function Meta(= meta)=C2=A0 local f =3D io.open(meta.m= etadata_file, 'r')
=C2=A0
local content =3D f:read('*a')
=C2=A0 f
:close()
=C2= =A0
return pandoc.read(content).meta
end


Safe the above to a file and = call pandoc with --lua-filter=3D<that-file>.lua and --metadata=3Dmeta= data_file:<your-yaml-file>. It will overwrite all metadata using= the contents of the yaml file.

See also this issue: https://github.com/jgm/pandoc/issu= es/3115

On Sunday, November 12, 2017 at 10:34:02 PM UTC+1, sc= l...-DpHT0TjK6O80n/F98K4Iww@public.gmane.org wrote:
Hmm ok - I'll look into that :)

The wor= kflow is probably more edge case from the standard use of pandoc for academ= ic writing.

What we want to achieve:
User -> editor of choice -> save in native format
Apply YAML metadata with user details and extracted customer/client deta= ils from CRM
Apply customised style to ensure consistency
Apply template to ensure consistent cover page, TOC format, copyright/co= nfidentiality notice, commercial in confidence footer

<= div>Export to PDF for all the good reasons you use PDF for official documen= ts ;)



--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/2b1dba89-0544-49a0-954d-cad4c269fc78%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_11684_1112244562.1510616273529-- ------=_Part_11683_1026645091.1510616273529--