DocSaveOptions

Inheritance: java.lang.Object, com.aspose.pdf.SaveOptions com.aspose.pdf.UnifiedSaveOptions com.aspose.pdf.DocSaveOptions, com.aspose.pdf.SaveOptions, com.aspose.pdf.UnifiedSaveOptions com.aspose.pdf.DocSaveOptions, com.aspose.pdf.UnifiedSaveOptions, com.aspose.pdf.DocSaveOptions

All Implemented Interfaces: IPipelineOptions

public class DocSaveOptions extends UnifiedSaveOptions implements IPipelineOptions

Save options for export to Doc format

Constructors

ConstructorDescription
DocSaveOptionsConstructor

Methods

MethodDescription
getBatchSizeDefines batch size if batched conversion is applicable to source and destination formats pair.
getCustomProgressHandler

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; } } 
getFormatGet output format
getImageResolutionXConverted images X resolution.
getImageResolutionYConverted images Y resolution.
getMaxDistanceBetweenTextLinesThis parameter is used for grouping text lines into paragraphs. Determines how far apart can be two relative text lines. Specified in hundreds of percent of the text lines height.
getMemorySaveModePathDefines the path (file name or directory name) to hold temporary data when converting in memory save mode.
getModeRecognition mode.
getRelativeHorizontalProximityIn 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.
isAddReturnToLineEndIs used paragraph or line breaks.
isConvertType3FontsGets or sets conversion for Type3 fonts. In Type 3 fonts, glyphs shall be defined by streams of graphics operators. This means that in the DOC/DOCX output we see images instead of text. Set this flag to true to convert Type3 fonts to TTF and get text in the resulting file.
isRecognizeBulletsSwitch on the recognition of bullets.
isReSaveFontsGets or sets the procedure for resaving fonts. If set to true, we reload fonts on every page to avoid the influence of previous font properties and load the newly created font from scratch. Set this option to false if you want to improve performance. The default value is true;
setAddReturnToLineEndUse paragraph or line breaks
setBatchSizeDefines batch size if batched conversion is applicable to source and destination formats pair.
setConvertType3FontsGets or sets conversion for Type3 fonts. In Type 3 fonts, glyphs shall be defined by streams of graphics operators. This means that in the DOC/DOCX output we see images instead of text. Set this flag to true to convert Type3 fonts to TTF and get text in the resulting file.
setCustomProgressHandlerThis handler can be used to handle conversion progress events f.e.
setFormatSet output format
setImageResolutionXConverted images X resolution.
setImageResolutionYConverted images Y resolution.
setMaxDistanceBetweenTextLinesThis parameter is used for grouping text lines into paragraphs. Determines how far apart can be two relative text lines. Specified in hundreds of percent of the text lines height.
setMemorySaveModePathDefines the path (file name or directory name) to hold temporary data when converting in memory save mode.
setModeRecognition mode.
setRecognizeBulletsSwitch on the recognition of bullets.
setRelativeHorizontalProximityIn 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.
setReSaveFontsGets or sets the procedure for resaving fonts. If set to true, we reload fonts on every page to avoid the influence of previous font properties and load the newly created font from scratch. Set this option to false if you want to improve performance. The default value is true;

DocSaveOptions

public DocSaveOptions()

Constructor

getBatchSize

public final int getBatchSize()

Defines batch size if batched conversion is applicable to source and destination formats pair.

Returns: int value

getCustomProgressHandler

public UnifiedSaveOptions.ConversionProgressEventHandler getCustomProgressHandler()

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; } } 

Returns: ConversionProgressEventHandler instance

getFormat

public DocSaveOptions.DocFormat getFormat()

Get output format

Returns: DocFormat element @see com.aspose.pdf.DocSaveOptions.DocFormat

getImageResolutionX

public int getImageResolutionX()

Converted images X resolution.

Returns: int value

getImageResolutionY

public int getImageResolutionY()

Converted images Y resolution.

Returns: int value

getMaxDistanceBetweenTextLines

public float getMaxDistanceBetweenTextLines()

This parameter is used for grouping text lines into paragraphs. Determines how far apart can be two relative text lines. Specified in hundreds of percent of the text lines height.

Returns: float value

getMemorySaveModePath

public final String getMemorySaveModePath()

Defines the path (file name or directory name) to hold temporary data when converting in memory save mode.

Returns: String value

getMode

public DocSaveOptions.RecognitionMode getMode()

Recognition mode.

Returns: RecognitionMode value @see RecognitionMode

getRelativeHorizontalProximity

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.

Returns: Relative proximity

isAddReturnToLineEnd

public boolean isAddReturnToLineEnd()

Is used paragraph or line breaks.

Returns: boolean value.

isConvertType3Fonts

public final boolean isConvertType3Fonts()

Gets or sets conversion for Type3 fonts. In Type 3 fonts, glyphs shall be defined by streams of graphics operators. This means that in the DOC/DOCX output we see images instead of text. Set this flag to true to convert Type3 fonts to TTF and get text in the resulting file.

Returns: boolean value

isRecognizeBullets

public boolean isRecognizeBullets()

Switch on the recognition of bullets.

Returns: boolean value

isReSaveFonts

public final boolean isReSaveFonts()

Gets or sets the procedure for resaving fonts. If set to true, we reload fonts on every page to avoid the influence of previous font properties and load the newly created font from scratch. Set this option to false if you want to improve performance. The default value is true;

Returns: boolean value

setAddReturnToLineEnd

public void setAddReturnToLineEnd(boolean value)

Use paragraph or line breaks

Parameters:

ParameterTypeDescription
valueboolean value.

setBatchSize

public final void setBatchSize(int value)

Defines batch size if batched conversion is applicable to source and destination formats pair.

Parameters:

ParameterTypeDescription
value

setConvertType3Fonts

public final void setConvertType3Fonts(boolean value)

Gets or sets conversion for Type3 fonts. In Type 3 fonts, glyphs shall be defined by streams of graphics operators. This means that in the DOC/DOCX output we see images instead of text. Set this flag to true to convert Type3 fonts to TTF and get text in the resulting file.

Parameters:

ParameterTypeDescription
valueboolean value

setCustomProgressHandler

This handler can be used to handle conversion progress events f.e.

setFormat

Set output format

setImageResolutionX

public void setImageResolutionX(int value)

Converted images X resolution.

Parameters:

ParameterTypeDescription
valueint value

setImageResolutionY

public void setImageResolutionY(int value)

Converted images Y resolution.

Parameters:

ParameterTypeDescription
valueint value

setMaxDistanceBetweenTextLines

public void setMaxDistanceBetweenTextLines(float value)

This parameter is used for grouping text lines into paragraphs. Determines how far apart can be two relative text lines. Specified in hundreds of percent of the text lines height.

Parameters:

ParameterTypeDescription
valuefloat value

setMemorySaveModePath

Defines the path (file name or directory name) to hold temporary data when converting in memory save mode.

setMode

Recognition mode.

setRecognizeBullets

public void setRecognizeBullets(boolean value)

Switch on the recognition of bullets.

Parameters:

ParameterTypeDescription
valueboolean value

setRelativeHorizontalProximity

public 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.

Parameters:

ParameterTypeDescription
valueRelative proximity

setReSaveFonts

public final void setReSaveFonts(boolean value)

Gets or sets the procedure for resaving fonts. If set to true, we reload fonts on every page to avoid the influence of previous font properties and load the newly created font from scratch. Set this option to false if you want to improve performance. The default value is true;

Parameters:

ParameterTypeDescription
valueboolean value