0

I'm using Docx4J to make an invoice model.

In the left-side of the page, it's usual to show a legal sentence as: Registered company in ... Book ... Page ...

I have inserted this in my template with a Word text frame.

enter image description here

Well, my issue is: when exporting to .docx, this legal text is shown perfect, but when exporting to .pdf, it's shown as an horizontal table under the other data.

The code to export to PDF is:

FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setFoDumpFile(foDumpFile);
foSettings.setWmlPackage(template);

fos = new FileOutputStream(new File("/C:/mypath/prueba_OUT.pdf"));
Docx4J.toFO(foSettings, fos, Docx4J.FLAG_EXPORT_PREFER_XSL);

Any help would be very appreciated. Thanks.

yaki_nuka
  • 724
  • 4
  • 26
  • 44

1 Answers1

0

You'd need to extend the PDF via FO code; see further How to correctly position a header image with docx4j?

Float left may or may not be easy; similarly the rotated text.

In general, the way to work on this is to take the FO generated by docx4j, then hand edit it to something which FOP can convert to a PDF you are happy with. If you can do that, then its a matter of modifying docx4j to generate that FO.

Community
  • 1
  • 1
JasonPlutext
  • 15,352
  • 4
  • 44
  • 84
  • thank you for your answer. I'm looking for any other alternative, and it could be possible with svg (see http://www.coderanch.com/t/499739/XML/Vertical-text-PDF-FOP ). It seems that the text colud be rotated with svg tag options in FOP. Is there any way to handle it with Docx4J? Thanks a lot, jason. – yaki_nuka Jul 29 '14 at 07:50