ExtractionOptions (attached to a FileConvertJob) specifies how embedded images and attachments should be handled.
public class ExtractionOptions;
ExtractionOptions.java
During conversion, embedded images and attachments can be extracted to a folder, with links to the extracted images and attachments inserted in the output.
Example:
com.dtsearch.engine.FileConverter cj = new com.dtsearch.engine.FileConverter(); cj.setInputFile(inputFilename); cj.setOutputToString(true); cj.setOutputFormat(com.dtsearch.engine.OutputFormats.itHTML); com.dtsearch.engine.ExtractionOptions exo = new com.dtsearch.engine.ExtractionOptions(); exo.setOutputLocation("c:\\output"); exo.setOutputReference("c:\\output"); // This prevents attachments from being written with executable extensions like .exe or .bat exo.setAllowedExtensions("doc docx xls xlsx ppt pptx jpg jpeg png txt zip xml pdf wpd"); // Attachments with disallowed extensions will have ".data" appended to the filename exo.setDefaultExtension("data"); exo.setFlags(ExtractionOptionsFlags.dtsExoExtractImages | ExtractionOptionsFlags.dtsExoExtractAttachments | ExtractionOptionsFlags.dtsExoLimitExtensions); cj.setExtractionOptions(exo); cj.execute();
|
Method |
Description |
|
If the dtsExoLimitExtensions flag is set, image and attachment filename extensions will be limited to the values listed in allowedExtensions. | |
|
Extension to add to images and attachments when the dtsExoLimitExtensions flags is set and an image or attachment has an extension that is not listed in allowedExtensions. | |
|
Filename prefix for extracted files stored in outputLocation | |
|
ExtractionOptionsFlags value. | |
|
Name of text file to create with the names of all images and attachments extracted to the outputLocation. | |
|
Output folder for images and attachments extracted from the input file | |
|
URL of the outputLocation for links in the conversion output. | |
|
Text to use for link to an attachment that has no name |
|
Method |
|
Copyright (c) 1998-2012 dtSearch Corp. All rights reserved.
|