com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class DocSaveOptions



  • public class DocSaveOptions
    extends UnifiedSaveOptions

    Save options for export to Doc format

    • Field Detail

      • CustomProgressHandler

        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 Aspose.Pdf.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;
             }
          }
         
    • Constructor Detail

      • DocSaveOptions

        public DocSaveOptions()

        Constructor

    • Method Detail

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

        public boolean isRecognizeBullets()

        Switch on the recognition of bullets.

        Returns:
        boolean value
      • setRecognizeBullets

        public void setRecognizeBullets(boolean value)

        Switch on the recognition of bullets.

        Parameters:
        value - boolean value
      • isAddReturnToLineEnd

        public boolean isAddReturnToLineEnd()

        Is used paragraph or line breaks.

        Returns:
        boolean value.
      • setAddReturnToLineEnd

        public void setAddReturnToLineEnd(boolean value)

        Use paragraph or line breaks

        Parameters:
        value - boolean value.
      • getImageResolutionX

        public int getImageResolutionX()

        Converted images X resolution.

        Returns:
        int value
      • setImageResolutionX

        public void setImageResolutionX(int value)

        Converted images X resolution.

        Parameters:
        value - int value
      • getImageResolutionY

        public int getImageResolutionY()

        Converted images Y resolution.

        Returns:
        int value
      • setImageResolutionY

        public void setImageResolutionY(int value)

        Converted images Y resolution.

        Parameters:
        value - int value
      • setFormat

        public void setFormat(int value)

        Set output format

        Parameters:
        value - DocFormat element
        See Also:
        DocSaveOptions.DocFormat