Question

Writing multi page word document

  • 29 October 2018
  • 1 reply
  • 8 views

Badge

I’d like to create a multi-page word document grouping text, table, raster map with point and image per page. I’ve managed to do this in PDF using PDFPageFormatter but can’t find equivalent functionality in word transformers? I’ve looked at MSWordStyler and MSWordGnerator but still can’t see how to group items to write to individual pages. Can anyone help?

Thanks

Chris


1 reply

Userlevel 4
Badge +13

Hi -- the mental model for the MS Word writer/styler is that data will get written in the order that it hits the writer. So you'll need to use a sorter to ensure the right order (most likely -- unless you can get the data to be in the right order by carefully checking the output order of any places with multiple outputs).

So add a count for each "group", and then a constant for each part (i.e. 1 for text, 2 for table, 3 for map, 4 for the page break) that you create in the styler. Then prior to the writer use a sorter to sort by group first, and part second. That should bring you the joy you desire.

Reply