Office Template Generates Blank Pages where conditional content is located

WebViewer Version: 8.7.0

Please give a brief summary of your issue:
We are using Word Templates to generate content based on token replacement. We have several large sections on a template that are conditionally printed based on if a value is true or false. The word template generates the correct content however there are blank pages generated where the conditional content is in the template. Is there a way to make sure the generated document also trims the extra blank pages ?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hi tpartida,

Thank you for contacting WebViewer forum support.

Are the extra blank pages generated on WebViewer or the print preview panel?

If you want to remove selected pages, you can use the removePages method:
PDFTron WebViewer Class: Document (Note that this is for PDFs so you will need to use the loadAsPDF when instantiating WebViewer PDFTron WebViewer Global)

If the issue is related to print preview, you may need to update to the newest 8.7 as it was patched in the change-log here: PDFTron Systems Inc. | Documentation

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.

the issue was the template had hidden section areas that was creating a blank page when within an if statement. The section was still generating. when I removed the section, the template generated correctly

Hi tpartida,

Glad it worked out for you, thank you for the update.

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.