Page 1 of 1

Including Contents when inserting fields; pagination

PostPosted: Sun Feb 10, 2019 6:57 am
by neallester2
I am creating a document (from "scratch"). One intended use case is to render the document as a PDF on a (Linux) server without ever opening it in MS Word.When inserting fields (e.g. SEQ, REF, PAGEREF) in MS Word the resulting document includes a w:t element with the computed value of the field (e.g. "1" for SEQ, PAGEREF; "Bookmarked Text" for ref0. When building such a document in docx4j, do I need to add those computed field values? If so, how do I determine the value for a PAGEREF? Unlike SEQ & REF, I don't necessarily know what that value will end up as.

Re: Including Contents when inserting fields; pagination

PostPosted: Mon Feb 11, 2019 8:35 pm
by jason
Hi Neal

Our commercial PDF Converter will populate PAGEREF as necessary, so if you only need it for PDF, you can just leave it to that.

The PDF stuff (commercial or export-FO) can also be used to get page numbers, typically for putting the correct values in a table of contents, so the user doesn't need to open Word to do so. See further https://github.com/plutext/docx4j/blob/ ... .java#L671