public class DocSaveOptions extends UnifiedSaveOptions implements IPipelineOptions
Save options for export to Doc format
Modifier and Type | Class and Description |
---|---|
static class |
DocSaveOptions.DocFormat
Allows to specify .doc or .docx file format.
|
static class |
DocSaveOptions.RecognitionMode
Allows to control how a PDF document is converted into a word processing document.
|
UnifiedSaveOptions.ConversionProgressEventHandler, UnifiedSaveOptions.ProgressEventHandlerInfo
SaveOptions.BorderInfo, SaveOptions.BorderPartStyle, SaveOptions.HtmlBorderLineType, SaveOptions.MarginInfo, SaveOptions.MarginPartStyle, SaveOptions.NodeLevelResourceType, SaveOptions.ResourceSavingInfo
Modifier and Type | Field and Description |
---|---|
UnifiedSaveOptions.ConversionProgressEventHandler |
CustomProgressHandler
This handler can be used to handle conversion progress events f.e. it can be used to show
progress bar or messages about current amount of processed pages, example of handler's code
that shows progress on console is :
public static void convertWithShowingProgress()
{
(new License()).setLicense("License\\Aspose.Total.lic");
Document doc = new Document("Booklet.pdf");
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setCustomProgressHandler ( new HtmlSaveOptions.conversionProgressEventHandler(ShowProgressOnConsole));
doc.save("Booklet.doc", saveOptions);
System.in.read();
}
public static void showProgressOnConsole(HtmlSaveOptions.ProgressEventHandlerInfo eventInfo)
{
switch (eventInfo.getEventType())
{
case HtmlSaveOptions.ProgressEventType.TotalProgress:
Console.WriteLine("%s - Conversion progress : %s ."
|
ProgressEventsRetranslator, TryMergeAdjacentSameBackgroundImages
Constructor and Description |
---|
DocSaveOptions()
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getBatchSize()
Defines batch size if batched conversion is applicable
to source and destination formats pair.
|
int |
getFormat()
Get output format
|
int |
getImageResolutionX()
Converted images X resolution.
|
int |
getImageResolutionY()
Converted images Y resolution.
|
float |
getMaxDistanceBetweenTextLines()
This parameter is used for grouping text lines into paragraphs.
|
int |
getMode()
Recognition mode.
|
float |
getRelativeHorizontalProximity()
In Pdf words may be innerly represented with operators that prints words by independently
printing their letters or syllables.
|
boolean |
isAddReturnToLineEnd()
Is used paragraph or line breaks.
|
boolean |
isRecognizeBullets()
Switch on the recognition of bullets.
|
void |
setAddReturnToLineEnd(boolean value)
Use paragraph or line breaks
|
void |
setBatchSize(int value)
Defines batch size if batched conversion is applicable
to source and destination formats pair.
|
void |
setFormat(int value)
Set output format
|
void |
setImageResolutionX(int value)
Converted images X resolution.
|
void |
setImageResolutionY(int value)
Converted images Y resolution.
|
void |
setMaxDistanceBetweenTextLines(float value)
This parameter is used for grouping text lines into paragraphs.
|
void |
setMode(int value)
Recognition mode.
|
void |
setRecognizeBullets(boolean value)
Switch on the recognition of bullets.
|
void |
setRelativeHorizontalProximity(float value)
In Pdf words may be innerly represented with operators that prints words by independently
printing their letters or syllables.
|
isExtractOcrSublayerOnly, setExtractOcrSublayerOnly
getSaveFormat, getWarningHandler, isCloseResponse, setCloseResponse, setWarningHandler
public UnifiedSaveOptions.ConversionProgressEventHandler CustomProgressHandler
This handler can be used to handle conversion progress events f.e. it can be used to show progress bar or messages about current amount of processed pages, example of handler's code that shows progress on console is :
public static void convertWithShowingProgress() { (new License()).setLicense("License\\Aspose.Total.lic"); Document doc = new Document("Booklet.pdf"); HtmlSaveOptions saveOptions = new HtmlSaveOptions(); saveOptions.setCustomProgressHandler ( new HtmlSaveOptions.conversionProgressEventHandler(ShowProgressOnConsole)); doc.save("Booklet.doc", saveOptions); System.in.read(); } public static void showProgressOnConsole(HtmlSaveOptions.ProgressEventHandlerInfo eventInfo) { switch (eventInfo.getEventType()) { case HtmlSaveOptions.ProgressEventType.TotalProgress: Console.WriteLine("%s - Conversion progress : %s ."format(new Date().getTime(), eventInfo.getValue().toString())); break; case HtmlSaveOptions.ProgressEventType.SourcePageAnalized: Console.WriteLine("%s - Source page %s of %s analyzed.", (new Date().getTime().toString(), eventInfo.getValue().toString(), eventInfo.getMaxValue().toString())); break; case HtmlSaveOptions.ProgressEventType.ResultPageCreated: Console.WriteLine("%s - Result page's %s of %s layout created.", (new Date().getTime(), eventInfo.getValue().toString(), eventInfo.getMaxValue().toString())); break; case HtmlSaveOptions.ProgressEventType.ResultPageSaved: Console.WriteLine("{0} - Result page {1} of {2} exported.", (new Date().getTime(), eventInfo.getValue().toString(), eventInfo.getMaxValue().toString())); break; default: break; } }
public int getMode()
Recognition mode.
DocSaveOptions.RecognitionMode
public void setMode(int value)
Recognition mode.
value
- RecognitionMode valueDocSaveOptions.RecognitionMode
public float getRelativeHorizontalProximity()
In Pdf words may be innerly represented with operators that prints words by independently printing their letters or syllables. So, to detect words sometimes we need detect groups of independent chars that are in fact words. This setting defines width of space between text elements(letters, syllables) that must be treated as distance between words during recognition of words in source PDF. (presence of empty space at least with this width between letters means that textual elements pertain to different words). It's normed to font size - 1.0 means 100% of supposed word's font size. ATTENTION!It's used only in cases when source PDF contains specific rarely used fonts for which optimal value cannot be calculated from font. So, in vast majority of cases this parameter changes nothing in result document.
public float getMaxDistanceBetweenTextLines()
public void setMaxDistanceBetweenTextLines(float value)
value
- float valuepublic void setRelativeHorizontalProximity(float value)
In Pdf words may be innerly represented with operators that prints words by independently printing their letters or syllables. So, to detect words sometimes we need detect groups of independent chars that are in fact words. This setting defines width of space between text elements(letters, syllables) that must be treated as distance between words during recognition of words in source PDF. (presence of empty space at least with this width between letters means that textual elements pertain to different words). It's normed to font size - 1.0 means 100% of supposed word's font size. ATTENTION!It's used only in cases when source PDF contains specific rarely used fonts for which optimal value cannot be calculated from font. So, in vast majority of cases this parameter changes nothing in result document.
value
- Relative proximitypublic boolean isRecognizeBullets()
Switch on the recognition of bullets.
public void setRecognizeBullets(boolean value)
Switch on the recognition of bullets.
value
- boolean valuepublic boolean isAddReturnToLineEnd()
Is used paragraph or line breaks.
public void setAddReturnToLineEnd(boolean value)
Use paragraph or line breaks
value
- boolean value.public int getImageResolutionX()
Converted images X resolution.
public void setImageResolutionX(int value)
Converted images X resolution.
value
- int valuepublic int getImageResolutionY()
Converted images Y resolution.
public void setImageResolutionY(int value)
Converted images Y resolution.
value
- int valuepublic int getFormat()
Get output format
DocSaveOptions.DocFormat
public void setFormat(int value)
Set output format
value
- DocFormat elementDocSaveOptions.DocFormat
public final int getBatchSize()
Defines batch size if batched conversion is applicable to source and destination formats pair.
getBatchSize
in interface IPipelineOptions
public final void setBatchSize(int value)
Defines batch size if batched conversion is applicable to source and destination formats pair.
setBatchSize
in interface IPipelineOptions
value
- int value