throw new ReportingException("An error occurred while converting xls to pdf.", e);
}
}
private void doConvertToPdf(final String convertPattern, final byte[] documentBytes, final OutputStream outputStream) throws NoFreePortsException {
OfficeTask officeTask = new OfficeTask() {
@Override
public void processTaskInOpenOffice(OfficeResourceProvider ooResourceProvider) {
try {
XComponent xComponent = ooResourceProvider.loadXComponent(documentBytes);
saveAndClose(ooResourceProvider, xComponent, outputStream, convertPattern);