0

Is there a way to extract the XSL-FO from docx4j, or is there a guide (or existing code) to adapting the docx4j pdf output to emit PCL instead of PDF?

The task I am doing is to fill in the fields of a (docx) word document (and optionally remove them or not - i.e. maybe leave them filled in, or replace them with their value), then transform to PCL.

Marcin
  • 48,559
  • 18
  • 128
  • 201

1 Answers1

1

See pdf viaXSLFO, which creates XSLFO as an intermediate step (and optionally saves it).

You can modify that to give you PCL output. You'll need to change the line:

Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, os);

to

Fop fop = fopFactory.newFop(MimeConstants.MIME_PCL, os);

and add appropriate PCL stuff to the FOP config string, and if you are lucky that'll be it!

JasonPlutext
  • 15,352
  • 4
  • 44
  • 84
  • I've actually just tried that - there's only a little more to it. I don't know how well it's worked, I'm looking for a pcl viewer! – Marcin Jan 24 '12 at 21:29
  • Actually, this worked perfectly. I've summarised the tools and approach I took here: http://stackoverflow.com/questions/8974074/output-pcl-from-word-document-using-python – Marcin Jan 30 '12 at 19:06