ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: startMPpage..stopMPpage written to a separate PDF?
Date: Mon, 6 Apr 2020 09:42:21 +0200	[thread overview]
Message-ID: <72409B02-761C-4A8C-9947-E91DF9825B0A@elvenkind.com> (raw)
In-Reply-To: <4E6F4C4E-C277-401C-A4D4-2045B09837AA@rna.nl>



> On 5 Apr 2020, at 12:27, Gerben Wierda <Gerben.Wierda@rna.nl> wrote:
> 
> Alternatively, I could have a step before this to turn the input XML into many separate XMLs and have many ConTeXt runs. Probably that is the best way to do it. Each generated XML would have all of the original XML except it would only have one ‘view’ in it and the rest removed.

Or you could write out a shell script while processing the run. 

function moduledata.archimate(filename)
  local root = xml.load(filename)
  warnIfVerbose( "Processing %s", filename)
  local shfile = io.open(tex.jobname.. ".sh", "w")
  local i = 1
  for view in xml.collected(root,"diagrams/view") do
    local viewName = xml.text(view,"/name")
    shfile:write(string.format('mutool merge -o "%s.pdf" %s "%s.pdf" ', viewName, i, tex.jobname))
    i = i + 1
    ….
  end
  shfile:close()

and process that shell script at the end of the run.


___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-04-06  7:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04 22:29 Gerben Wierda
2020-04-05  9:34 ` Hans Hagen
2020-04-05 10:27   ` Gerben Wierda
2020-04-06  7:42     ` Taco Hoekwater [this message]
2020-04-06 12:49     ` Wolfgang Schuster

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=72409B02-761C-4A8C-9947-E91DF9825B0A@elvenkind.com \
    --to=taco@elvenkind.com \
    --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).