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
| Constructor | Description |
|---|---|
| DocSaveOptions | Constructor |
Methods
| Method | Description |
|---|---|
| getBatchSize | Defines 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; } } |
| getFormat | Get output format |
| getImageResolutionX | Converted images X resolution. |
| getImageResolutionY | Converted images Y resolution. |
| 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. |
| getMemorySaveModePath | Defines the path (file name or directory name) to hold temporary data when converting in memory save mode. |
| getMode | Recognition mode. |
| 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. |
| isAddReturnToLineEnd | Is used paragraph or line breaks. |
| 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. |
| isRecognizeBullets | Switch on the recognition of bullets. |
| 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; |
| setAddReturnToLineEnd | Use paragraph or line breaks |
| setBatchSize | Defines batch size if batched conversion is applicable to source and destination formats pair. |
| setConvertType3Fonts | 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. |
| setCustomProgressHandler | This handler can be used to handle conversion progress events f.e. |
| setFormat | Set output format |
| setImageResolutionX | Converted images X resolution. |
| setImageResolutionY | Converted images Y resolution. |
| setMaxDistanceBetweenTextLines | 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. |
| setMemorySaveModePath | Defines the path (file name or directory name) to hold temporary data when converting in memory save mode. |
| setMode | Recognition mode. |
| setRecognizeBullets | Switch on the recognition of bullets. |
| setRelativeHorizontalProximity | 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. |
| setReSaveFonts | 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; |
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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value. |
setBatchSize
public final void setBatchSize(int value)
Defines batch size if batched conversion is applicable to source and destination formats pair.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean 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:
| Parameter | Type | Description |
|---|---|---|
| value | int value |
setImageResolutionY
public void setImageResolutionY(int value)
Converted images Y resolution.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int 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:
| Parameter | Type | Description |
|---|---|---|
| value | float 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean 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:
| Parameter | Type | Description |
|---|---|---|
| value | Relative 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value |