Upgrade problems with CubaFormatterFactory

In upgrading from 6.6 to 6.7, I’m getting errors in my code. Thanks to previous advice, I corrected the reference to useOfficeForDocxConversion. But, I’m having trouble finding the replacement for .setPdfConverter and its argument. Advice please. Thanks
Eric

public class EricFormatterFactory  extends CubaFormatterFactory {
    public EricFormatterFactory() {

        // Do I need to call super()?

        FormatterCreator docxCreator = new FormatterCreator() {
            @Override
            public ReportFormatter create(FormatterFactoryInput factoryInput) {
                DocxFormatter docxFormatter = new EricDocxFormatter(factoryInput);
                docxFormatter.setDefaultFormatProvider(defaultFormatProvider);
                if (useOfficeForDocumentConversion) {
                    **docxFormatter.setPdfConverter(pdfConverter);**
                }
                return docxFormatter;
            }
        };
        formattersMap.put("docx", docxCreator);
    }
}

Hi Eric,

Put lines

if (useOfficeForDocumentConversion) {
  docxFormatter.setDocumentConverter(documentConverter);
}
docxFormatter.setHtmlImportProcessor(htmlImportProcessor);

instead of

if (useOfficeForDocumentConversion) {
    **docxFormatter.setPdfConverter(pdfConverter);**
}

Thanks for the advice - I’ll make those changes. I notice also that the routine is no longer an override - am I using the right one? Also, formatterMap.put no longer exists - so should I leave it out?

Thanks again for all your help.
Eric

Hi Eric,

formatterMap.put exists in the DefaultFormatterFactory. DefaultFormatterFactory is the parent for the CubaFormatterFactory.You overriden EricFormatterFactory correctly.

// Do I need to call super()?

Also EricFormatterFactory constructor should call super() for correct initialization.

Thank you,
Andrey