DocSaveOptions

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

All Implemented Interfaces: com.aspose.pdf.IPipelineOptions

public class DocSaveOptions extends UnifiedSaveOptions implements IPipelineOptions

Save options for export to Doc format

Constructors

Constructor Description
DocSaveOptions() Constructor

Methods

Method Description
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 :
setCustomProgressHandler(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 :
getMode() Recognition mode.
setMode(int value) Recognition mode.
getRelativeHorizontalProximity() In Pdf words may be innerly represented with operators that prints words by independently printing their letters or syllables.
getMaxDistanceBetweenTextLines() This parameter is used for grouping text lines into paragraphs.
setMaxDistanceBetweenTextLines(float value) This parameter is used for grouping text lines into paragraphs.
setRelativeHorizontalProximity(float value) In Pdf words may be innerly represented with operators that prints words by independently printing their letters or syllables.
isRecognizeBullets() Switch on the recognition of bullets.
setRecognizeBullets(boolean value) Switch on the recognition of bullets.
isAddReturnToLineEnd() Is used paragraph or line breaks.
setAddReturnToLineEnd(boolean value) Use paragraph or line breaks
getImageResolutionX() Converted images X resolution.
setImageResolutionX(int value) Converted images X resolution.
getImageResolutionY() Converted images Y resolution.
setImageResolutionY(int value) Converted images Y resolution.
getFormat() Get output format
setFormat(int value) Set output format
getBatchSize() Defines batch size if batched conversion is applicable to source and destination formats pair.
setBatchSize(int value) Defines batch size if batched conversion is applicable to source and destination formats pair.
getMemorySaveModePath() Defines the path (file name or directory name) to hold temporary data when converting in memory save mode.
setMemorySaveModePath(String value) Defines the path (file name or directory name) to hold temporary data when converting in memory save mode.

DocSaveOptions()

public DocSaveOptions()

Constructor

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 - ConversionProgressEventHandler instance

setCustomProgressHandler(UnifiedSaveOptions.ConversionProgressEventHandler customProgressHandler)

public void setCustomProgressHandler(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;
     }
  }

Parameters:

Parameter Type Description
customProgressHandler ConversionProgressEventHandler ConversionProgressEventHandler instance

getMode()

public int getMode()

Recognition mode.

Returns: int - RecognitionMode value

setMode(int value)

public void setMode(int value)

Recognition mode.

Parameters:

Parameter Type Description
value int RecognitionMode value

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: float - Relative proximity

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 - float value

setMaxDistanceBetweenTextLines(float value)

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 float value

setRelativeHorizontalProximity(float value)

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 float Relative proximity

isRecognizeBullets()

public boolean isRecognizeBullets()

Switch on the recognition of bullets.

Returns: boolean - boolean value

setRecognizeBullets(boolean value)

public void setRecognizeBullets(boolean value)

Switch on the recognition of bullets.

Parameters:

Parameter Type Description
value boolean boolean value

isAddReturnToLineEnd()

public boolean isAddReturnToLineEnd()

Is used paragraph or line breaks.

Returns: boolean - boolean value.

setAddReturnToLineEnd(boolean value)

public void setAddReturnToLineEnd(boolean value)

Use paragraph or line breaks

Parameters:

Parameter Type Description
value boolean boolean value.

getImageResolutionX()

public int getImageResolutionX()

Converted images X resolution.

Returns: int - int value

setImageResolutionX(int value)

public void setImageResolutionX(int value)

Converted images X resolution.

Parameters:

Parameter Type Description
value int int value

getImageResolutionY()

public int getImageResolutionY()

Converted images Y resolution.

Returns: int - int value

setImageResolutionY(int value)

public void setImageResolutionY(int value)

Converted images Y resolution.

Parameters:

Parameter Type Description
value int int value

getFormat()

public int getFormat()

Get output format

Returns: int - DocFormat element

setFormat(int value)

public void setFormat(int value)

Set output format

Parameters:

Parameter Type Description
value int DocFormat element

getBatchSize()

public final int getBatchSize()

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

Returns: int

setBatchSize(int value)

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 int

getMemorySaveModePath()

public final String getMemorySaveModePath()

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

Returns: java.lang.String - String value

setMemorySaveModePath(String value)

public final void setMemorySaveModePath(String value)

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

Parameters:

Parameter Type Description
value java.lang.String String value