Open GoogleCodeExporter opened 9 years ago
It is /possible/ to do this without changing JodConverter, but it's rather
inconvenient to do so.
This gets an interaction handler used:
String inputExtension = FilenameUtils.getExtension( inputFile.getName() );
DocumentFormat outputFormat = converter.getFormatRegistry().getFormatByExtension( destinationFormat );
StandardConversionTask conversionTask = new StandardConversionTask( inputFile, outputFile, outputFormat );
Map<String, Object> loadProperties = new HashMap<String, Object>();
loadProperties.put( "Hidden", true );
loadProperties.put( "ReadOnly", true );
// loadProperties.put("UpdateDocMode", UpdateDocMode.QUIET_UPDATE);
InteractionHandler handler = new InteractionHandler();
loadProperties.put( "InteractionHandler", handler );
conversionTask.setDefaultLoadProperties( loadProperties );
DocumentFormat inputFormat = converter.getFormatRegistry().getFormatByExtension( inputExtension );
conversionTask.setInputFormat( inputFormat );
ConversionResult result = new ConversionResult();
result.setCorrelationId( parameters.getCorrelationId() );
result.setDocumentID( parameters.getDocumentID() );
result.setSucceeded( true );
try {
webappContext.getOfficeManager().execute( conversionTask );
// converter.convert(inputFile, outputFile );
}
And I've attached the InteractionHandler I'm using.
Original comment by jim.tal...@groupgti.com
on 8 Nov 2011 at 10:22
Attachments:
Original issue reported on code.google.com by
mirko.na...@gmail.com
on 24 Jul 2009 at 10:04