{
if (isFormatFile()) {
MultiPassContentFormatter pdtFormatter = new MultiPassContentFormatter(
IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING,
IHTMLPartitions.HTML_DEFAULT);
pdtFormatter.setMasterStrategy(new StructuredFormattingStrategy(
new HTMLFormatProcessorImpl()));
pdtFormatter.format(document, region);
} else {
StructuredTextMultiPassContentFormatter pdtFormatter = new StructuredTextMultiPassContentFormatter(
IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING,
IHTMLPartitions.HTML_DEFAULT);
pdtFormatter.setMasterStrategy(new StructuredFormattingStrategy(
new TwigFormatProcessorImpl()));
pdtFormatter.format(document, region);
// pdtFormatter.format(document, region);
}