Loading ...
Sorry, an error occurred while loading the content.

Re: batch pdf generation

Expand Messages
  • eslaf1234
    You need to do it in two stages. Export base.xml then run fop to produce the pdf. As you are using unix you could do something like #!/bin/bash
    Message 1 of 3 , Nov 26, 2009
    • 0 Attachment
      You need to do it in two stages. Export base.xml then run fop to produce the pdf. As you are using unix you could do something like

      #!/bin/bash

      PCGENDIR=./pcgen5162RC1

      for pcg
      do
      pcg="$(readlink -f ${pcg})" # Need full path as pcgen.sh changes directory

      # Export base.xml
      ${PCGENDIR}/pcgen.sh -Dpcgen.templatefile="outputsheets/base.xml" \
      -Dpcgen.inputfile="${pcg}" \
      -Dpcgen.outputfile="${pcg%.pcg}.xml"

      # Produce pdf using fop- note classpath setup
      java -classpath "$(echo ${PCGENDIR}/lib/fop/*.jar | sed -e 's/ /:/g')" org.apache.fop.apps.Fop \
      -xml "${pcg%.pcg}.xml" \
      -xsl ${PCGENDIR}/outputsheets/d20/fantasy/pdf/csheet_fantasy_std_blackandwhite.xslt \
      -pdf "${pcg%.pcg}.pdf"
      done

      So run as scriptname.sh ~/.pcgen/characters/Character.pcg. Hopefully that is clear. Note this can take some time, the export can hang for minutes see http://sourceforge.net/tracker/?func=detail&aid=2836931&group_id=25576&atid=384719

      Mark

      --- In pcgen@yahoogroups.com, Susan Dittmar <Susan.Dittmar@...> wrote:
      >
      > Hello folks,
      >
      > is there a way to batch-process character files to create *PDF* output?
      > I know how to create html-output, but somehow I can't get batch pdf
      > generation up and running. Can someone of you help me please? In case it
      > matters, I am running linux (openSUSE).
      >
      > Thanks in advance,
      >
      > Susan
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • Susan Dittmar
      Thanks a lot, Mark! I put a variant of this into my Makefile suite, and it works like a charm. Hooray! With my small and slow laptop it s soooo much easier
      Message 2 of 3 , Nov 26, 2009
      • 0 Attachment
        Thanks a lot, Mark! I put a variant of this into my Makefile suite, and it
        works like a charm.

        Hooray! With my small and slow laptop it's soooo much easier generating
        output sheet via script than having to remember to call all those steps
        in the GUI each time you edit some character.

        Btw, a big hug to those who worked on making PCGen faster. With my setup
        this change is truely notable!!!

        Susan


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.