com.aspose.cells

Class PdfSaveOptions

  • java.lang.Object
public class PdfSaveOptions 
extends SaveOptions

Represents the options for saving pdf file.

Constructor Summary
PdfSaveOptions()
Creates the options for saving pdf file.
PdfSaveOptions(intsaveFormat)
Creates the options for saving pdf file.
 
Property Getters/Setters Summary
booleangetAllColumnsInOnePagePerSheet()
void
           If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be ignored, and the other settings of pagesetup will still take effect.
PdfBookmarkEntrygetBookmark()
void
           Gets and sets the PdfBookmarkEntry object.
java.lang.StringgetCachedFileFolder()
void
setCachedFileFolder(java.lang.Stringvalue)
           The cached file folder is used to store some large data.
booleangetCalculateFormula()
void
setCalculateFormula(booleanvalue)
           Indicates whether calculate formulas before saving pdf file.
booleangetCheckFontCompatibility()
void
           Indicates whether check font compatibility for every character in text.
booleangetCheckWorkbookDefaultFont()
void
           When characters in the Excel are unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook's default font to show these characters first.
booleangetClearData()
void
setClearData(booleanvalue)
           Make the workbook empty after saving the file.
intgetCompliance()
void
setCompliance(intvalue)
           Workbook converts to pdf will according to PdfCompliance in this property. The value of the property is PdfCompliance integer constant.
booleangetCreateDirectory()
void
setCreateDirectory(booleanvalue)
           If true and the directory does not exist, the directory will be automatically created before saving the file.
com.aspose.cells.DateTimegetCreatedTime()
void
setCreatedTime(com.aspose.cells.DateTimevalue)
           Gets and sets the time of generating the pdf document.
intgetCustomPropertiesExport()
void
           Gets or sets a value determining the way CustomDocumentPropertyCollection are exported to PDF file. Default value is None. The value of the property is PdfCustomPropertiesExport integer constant.
java.lang.StringgetDefaultFont()
void
setDefaultFont(java.lang.Stringvalue)
           When characters in the Excel are unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.
booleangetDisplayDocTitle()
void
setDisplayDocTitle(booleanvalue)
           Indicate whether the window's title bar should display the document title.
DrawObjectEventHandlergetDrawObjectEventHandler()
void
           Implements this interface to get DrawObject and Bound when rendering.
booleangetEmbedStandardWindowsFonts()
void
           True to embed true type fonts. Affects only ASCII characters 32-127. Fonts for character codes greater than 127 are always embedded. PDFA1B must embeded font. Default is true.
intgetEmfRenderSetting()
void
           Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant.
booleangetEnableHTTPCompression()
void
           Indicates if http compression is to be used in user's IIS.
booleangetExportDocumentStructure()
void
           Gets or sets a value determining whether or not to export document structure.
intgetGridlineType()
void
setGridlineType(intvalue)
           Gets or sets gridline type. The value of the property is GridlineType integer constant.
booleangetIgnoreError()
void
setIgnoreError(booleanvalue)
           Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc.
com.aspose.cells.ImageFormatgetImageType()
void
setImageType(com.aspose.cells.ImageFormatvalue)
           Represents the image type when converting the chart and shape .
booleanisFontSubstitutionCharGranularity()
void
           Indicates whether only substitute the font of character when the cell font is not compatibility for it.
booleangetMergeAreas()
void
setMergeAreas(booleanvalue)
           Indicates whether merge the areas of conditional formatting and validation before saving the file.
booleangetOnePagePerSheet()
void
setOnePagePerSheet(booleanvalue)
           If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.
intgetOptimizationType()
void
           Gets and sets pdf optimization type. The value of the property is PdfOptimizationType integer constant.
booleangetOutputBlankPageWhenNothingToPrint()
void
           Indicates whether to output a blank page when there is nothing to print.
intgetPageCount()
void
setPageCount(intvalue)
           Gets or sets the number of pages to save.
intgetPageIndex()
void
setPageIndex(intvalue)
           Gets or sets the 0-based index of the first page to save.
IPageSavingCallbackgetPageSavingCallback()
void
           Control/Indicate progress of page saving process.
intgetPdfCompression()
void
           Indcate the compression algorithm The value of the property is PdfCompressionCore integer constant.
java.lang.StringgetPdfExportImagesFolder()
void
setPdfExportImagesFolder(java.lang.Stringvalue)
           The physical folder where images will be saved when exporting a workbook to Aspose.Pdf XML format. Default is an empty string.
intgetPrintingPageType()
void
           Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.
booleangetRefreshChartCache()
void
setRefreshChartCache(booleanvalue)
           Indicates whether refreshing chart cache data
intgetSaveFormat()
Gets the save file format. The value of the property is SaveFormat integer constant.
PdfSecurityOptionsgetSecurityOptions()
void
           Set this options, when security is need in xls2pdf result.
booleangetSortNames()
void
setSortNames(booleanvalue)
           Indicates whether sorting defined names before saving file.
IStreamProvidergetStreamProvider()
void
           Gets or sets the IStreamProvider for exporting objects.
intgetTextCrossType()
void
           Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossType integer constant.
booleangetValidateMergedAreas()
void
           Indicates whether validate merged cells before saving the file.
IWarningCallbackgetWarningCallback()
void
           Gets or sets warning callback.
 
Method Summary
voidsetImageResample(int desiredPPI, int jpegQuality)
Set desired PPI(pixels per inch) of resample images and jpeg quality All images will be converted to JPEG with the specified quality setting, and images that are greater than the specified PPI (pixels per inch) will be resampled.
 

    • Constructor Detail

      • PdfSaveOptions

        public PdfSaveOptions()
        Creates the options for saving pdf file.
      • PdfSaveOptions

        public PdfSaveOptions(int saveFormat)
        Creates the options for saving pdf file.
        Parameters:
        saveFormat - A SaveFormat value. The save format.It must be pdf.
    • Property Getters/Setters Detail

      • getPrintingPageType/setPrintingPageType

        public int getPrintingPageType() / public void setPrintingPageType(int value)
        
        Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.
      • getEmbedStandardWindowsFonts/setEmbedStandardWindowsFonts

        public boolean getEmbedStandardWindowsFonts() / public void setEmbedStandardWindowsFonts(boolean value)
        
        True to embed true type fonts. Affects only ASCII characters 32-127. Fonts for character codes greater than 127 are always embedded. PDFA1B must embeded font. Default is true.
      • getCompliance/setCompliance

        public int getCompliance() / public void setCompliance(int value)
        
        Workbook converts to pdf will according to PdfCompliance in this property. The value of the property is PdfCompliance integer constant.
      • getDefaultFont/setDefaultFont

        public java.lang.String getDefaultFont() / public void setDefaultFont(java.lang.String value)
        
        When characters in the Excel are unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.
      • getCheckWorkbookDefaultFont/setCheckWorkbookDefaultFont

        public boolean getCheckWorkbookDefaultFont() / public void setCheckWorkbookDefaultFont(boolean value)
        
        When characters in the Excel are unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook's default font to show these characters first. Default is true.
      • getSecurityOptions/setSecurityOptions

        public PdfSecurityOptions getSecurityOptions() / public void setSecurityOptions(PdfSecurityOptions value)
        
        Set this options, when security is need in xls2pdf result.
      • getOnePagePerSheet/setOnePagePerSheet

        public boolean getOnePagePerSheet() / public void setOnePagePerSheet(boolean value)
        
        If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.
      • getAllColumnsInOnePagePerSheet/setAllColumnsInOnePagePerSheet

        public boolean getAllColumnsInOnePagePerSheet() / public void setAllColumnsInOnePagePerSheet(boolean value)
        
        If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be ignored, and the other settings of pagesetup will still take effect.
      • getImageType/setImageType

        public com.aspose.cells.ImageFormat getImageType() / public void setImageType(com.aspose.cells.ImageFormat value)
        
        Represents the image type when converting the chart and shape .
      • getCalculateFormula/setCalculateFormula

        public boolean getCalculateFormula() / public void setCalculateFormula(boolean value)
        
        Indicates whether calculate formulas before saving pdf file. The default value is false.
      • getPdfCompression/setPdfCompression

        public int getPdfCompression() / public void setPdfCompression(int value)
        
        Indcate the compression algorithm The value of the property is PdfCompressionCore integer constant.
      • getStreamProvider/setStreamProvider

        public IStreamProvider getStreamProvider() / public void setStreamProvider(IStreamProvider value)
        
        Gets or sets the IStreamProvider for exporting objects. NOTE: This member is now obsolete. Instead, please use Border property. This property will be removed 12 months later since January 2018. Aspose apologizes for any inconvenience you may have experienced.
      • getCheckFontCompatibility/setCheckFontCompatibility

        public boolean getCheckFontCompatibility() / public void setCheckFontCompatibility(boolean value)
        
        Indicates whether check font compatibility for every character in text. The default value is true. Disable this property may give better performance. But when the default or specified font of text/character cannot be used to render it, unreadable characters(such as block) maybe occur in the generated pdf. For such situation user should keep this property as true so that alternative font can be searched and used to render the text instead;
      • getPageIndex/setPageIndex

        public int getPageIndex() / public void setPageIndex(int value)
        
        Gets or sets the 0-based index of the first page to save. Default is 0.
      • getPageCount/setPageCount

        public int getPageCount() / public void setPageCount(int value)
        
        Gets or sets the number of pages to save. Default is System.Int32.MaxValue which means all pages will be rendered..
      • getCreatedTime/setCreatedTime

        public com.aspose.cells.DateTime getCreatedTime() / public void setCreatedTime(com.aspose.cells.DateTime value)
        
        Gets and sets the time of generating the pdf document. if it is not be set, it will be the time of generating the pdf.
      • getOptimizationType/setOptimizationType

        public int getOptimizationType() / public void setOptimizationType(int value)
        
        Gets and sets pdf optimization type. The value of the property is PdfOptimizationType integer constant.
      • isFontSubstitutionCharGranularity/setFontSubstitutionCharGranularity

        public boolean isFontSubstitutionCharGranularity() / public void setFontSubstitutionCharGranularity(boolean value)
        
        Indicates whether only substitute the font of character when the cell font is not compatibility for it. Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.
      • getGridlineType/setGridlineType

        public int getGridlineType() / public void setGridlineType(int value)
        
        Gets or sets gridline type. The value of the property is GridlineType integer constant. Default is Dotted type.
      • getTextCrossType/setTextCrossType

        public int getTextCrossType() / public void setTextCrossType(int value)
        
        Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossType integer constant.
      • getIgnoreError/setIgnoreError

        public boolean getIgnoreError() / public void setIgnoreError(boolean value)
        
        Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc.
      • getOutputBlankPageWhenNothingToPrint/setOutputBlankPageWhenNothingToPrint

        public boolean getOutputBlankPageWhenNothingToPrint() / public void setOutputBlankPageWhenNothingToPrint(boolean value)
        
        Indicates whether to output a blank page when there is nothing to print. Default is true.
      • getDrawObjectEventHandler/setDrawObjectEventHandler

        public DrawObjectEventHandler getDrawObjectEventHandler() / public void setDrawObjectEventHandler(DrawObjectEventHandler value)
        
        Implements this interface to get DrawObject and Bound when rendering.
      • getCustomPropertiesExport/setCustomPropertiesExport

        public int getCustomPropertiesExport() / public void setCustomPropertiesExport(int value)
        
        Gets or sets a value determining the way CustomDocumentPropertyCollection are exported to PDF file. Default value is None. The value of the property is PdfCustomPropertiesExport integer constant.
      • getExportDocumentStructure/setExportDocumentStructure

        public boolean getExportDocumentStructure() / public void setExportDocumentStructure(boolean value)
        
        Gets or sets a value determining whether or not to export document structure.
      • getPageSavingCallback/setPageSavingCallback

        public IPageSavingCallback getPageSavingCallback() / public void setPageSavingCallback(IPageSavingCallback value)
        
        Control/Indicate progress of page saving process.
      • getEmfRenderSetting/setEmfRenderSetting

        public int getEmfRenderSetting() / public void setEmfRenderSetting(int value)
        
        Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. EMF metafiles identified as "EMF+ Dual" can contain both EMF+ records and EMF records. Either type of record can be used to render the image, only EMF+ records, or only EMF records. When #Error Cref: !:EmfRenderSetting.EmfPlusPrefer is set, then EMF+ records will be parsed while rendering to pdf, otherwise only EMF records will be parsed. Default value is #Error Cref: !:EmfRenderSetting.EmfOnly.
      • getDisplayDocTitle/setDisplayDocTitle

        public boolean getDisplayDocTitle() / public void setDisplayDocTitle(boolean value)
        
        Indicate whether the window's title bar should display the document title. If false, the title bar should instead display the name of the PDF file. Default value is false.
      • getSaveFormat

        public int getSaveFormat()
        
        Gets the save file format. The value of the property is SaveFormat integer constant.
      • getClearData/setClearData

        public boolean getClearData() / public void setClearData(boolean value)
        
        Make the workbook empty after saving the file.
      • getCachedFileFolder/setCachedFileFolder

        public java.lang.String getCachedFileFolder() / public void setCachedFileFolder(java.lang.String value)
        
        The cached file folder is used to store some large data.
      • getValidateMergedAreas/setValidateMergedAreas

        public boolean getValidateMergedAreas() / public void setValidateMergedAreas(boolean value)
        
        Indicates whether validate merged cells before saving the file. The default value is false.
      • getMergeAreas/setMergeAreas

        public boolean getMergeAreas() / public void setMergeAreas(boolean value)
        
        Indicates whether merge the areas of conditional formatting and validation before saving the file. The default value is false.
      • getCreateDirectory/setCreateDirectory

        public boolean getCreateDirectory() / public void setCreateDirectory(boolean value)
        
        If true and the directory does not exist, the directory will be automatically created before saving the file. The default value is false.
      • getSortNames/setSortNames

        public boolean getSortNames() / public void setSortNames(boolean value)
        
        Indicates whether sorting defined names before saving file.
      • getRefreshChartCache/setRefreshChartCache

        public boolean getRefreshChartCache() / public void setRefreshChartCache(boolean value)
        
        Indicates whether refreshing chart cache data
      • getPdfExportImagesFolder/setPdfExportImagesFolder

        public java.lang.String getPdfExportImagesFolder() / public void setPdfExportImagesFolder(java.lang.String value)
        
        The physical folder where images will be saved when exporting a workbook to Aspose.Pdf XML format. Default is an empty string.
      • getEnableHTTPCompression/setEnableHTTPCompression

        public boolean getEnableHTTPCompression() / public void setEnableHTTPCompression(boolean value)
        
        Indicates if http compression is to be used in user's IIS. Please specify this property to true if http compression is used.
      • getWarningCallback/setWarningCallback

        public IWarningCallback getWarningCallback() / public void setWarningCallback(IWarningCallback value)
        
        Gets or sets warning callback.

    setPrintingPageType

    public voidsetPrintingPageType(intvalue)
    
    Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant.

    setEmbedStandardWindowsFonts

    public voidsetEmbedStandardWindowsFonts(booleanvalue)
    
    True to embed true type fonts. Affects only ASCII characters 32-127. Fonts for character codes greater than 127 are always embedded. PDFA1B must embeded font. Default is true.

    setBookmark

    public voidsetBookmark(PdfBookmarkEntry value)
    
    Gets and sets the PdfBookmarkEntry object.

    setCompliance

    public voidsetCompliance(intvalue)
    
    Workbook converts to pdf will according to PdfCompliance in this property. The value of the property is PdfCompliance integer constant.

    setDefaultFont

    public voidsetDefaultFont(java.lang.Stringvalue)
    
    When characters in the Excel are unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set the DefaultFont such as MingLiu or MS Gothic to show these characters. If this property is not set, Aspose.Cells will use system default font to show these unicode characters.

    setCheckWorkbookDefaultFont

    public voidsetCheckWorkbookDefaultFont(booleanvalue)
    
    When characters in the Excel are unicode and not be set with correct font in cell style, They may appear as block in pdf,image. Set this to true to try to use workbook's default font to show these characters first. Default is true.

    setSecurityOptions

    public voidsetSecurityOptions(PdfSecurityOptions value)
    
    Set this options, when security is need in xls2pdf result.

    setOnePagePerSheet

    public voidsetOnePagePerSheet(booleanvalue)
    
    If OnePagePerSheet is true , all content of one sheet will output to only one page in result. The paper size of pagesetup will be invalid, and the other settings of pagesetup will still take effect.

    setAllColumnsInOnePagePerSheet

    public voidsetAllColumnsInOnePagePerSheet(booleanvalue)
    
    If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result. The width of paper size of pagesetup will be ignored, and the other settings of pagesetup will still take effect.

    setImageType

    public voidsetImageType(com.aspose.cells.ImageFormatvalue)
    
    Represents the image type when converting the chart and shape .

    setCalculateFormula

    public voidsetCalculateFormula(booleanvalue)
    
    Indicates whether calculate formulas before saving pdf file. The default value is false.

    setPdfCompression

    public voidsetPdfCompression(intvalue)
    
    Indcate the compression algorithm The value of the property is PdfCompressionCore integer constant.

    setStreamProvider

    public voidsetStreamProvider(IStreamProvider value)
    
    Gets or sets the IStreamProvider for exporting objects. NOTE: This member is now obsolete. Instead, please use Border property. This property will be removed 12 months later since January 2018. Aspose apologizes for any inconvenience you may have experienced.

    setCheckFontCompatibility

    public voidsetCheckFontCompatibility(booleanvalue)
    
    Indicates whether check font compatibility for every character in text. The default value is true. Disable this property may give better performance. But when the default or specified font of text/character cannot be used to render it, unreadable characters(such as block) maybe occur in the generated pdf. For such situation user should keep this property as true so that alternative font can be searched and used to render the text instead;

    setPageIndex

    public voidsetPageIndex(intvalue)
    
    Gets or sets the 0-based index of the first page to save. Default is 0.

    setPageCount

    public voidsetPageCount(intvalue)
    
    Gets or sets the number of pages to save. Default is System.Int32.MaxValue which means all pages will be rendered..

    setCreatedTime

    public voidsetCreatedTime(com.aspose.cells.DateTimevalue)
    
    Gets and sets the time of generating the pdf document. if it is not be set, it will be the time of generating the pdf.

    setOptimizationType

    public voidsetOptimizationType(intvalue)
    
    Gets and sets pdf optimization type. The value of the property is PdfOptimizationType integer constant.

    setFontSubstitutionCharGranularity

    public voidsetFontSubstitutionCharGranularity(booleanvalue)
    
    Indicates whether only substitute the font of character when the cell font is not compatibility for it. Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.

    setGridlineType

    public voidsetGridlineType(intvalue)
    
    Gets or sets gridline type. The value of the property is GridlineType integer constant. Default is Dotted type.

    setTextCrossType

    public voidsetTextCrossType(intvalue)
    
    Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossType integer constant.

    setIgnoreError

    public voidsetIgnoreError(booleanvalue)
    
    Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc.

    setOutputBlankPageWhenNothingToPrint

    public voidsetOutputBlankPageWhenNothingToPrint(booleanvalue)
    
    Indicates whether to output a blank page when there is nothing to print. Default is true.

    setDrawObjectEventHandler

    public voidsetDrawObjectEventHandler(DrawObjectEventHandler value)
    
    Implements this interface to get DrawObject and Bound when rendering.

    setCustomPropertiesExport

    public voidsetCustomPropertiesExport(intvalue)
    
    Gets or sets a value determining the way CustomDocumentPropertyCollection are exported to PDF file. Default value is None. The value of the property is PdfCustomPropertiesExport integer constant.

    setExportDocumentStructure

    public voidsetExportDocumentStructure(booleanvalue)
    
    Gets or sets a value determining whether or not to export document structure.

    setPageSavingCallback

    public voidsetPageSavingCallback(IPageSavingCallback value)
    
    Control/Indicate progress of page saving process.

    setEmfRenderSetting

    public voidsetEmfRenderSetting(intvalue)
    
    Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. EMF metafiles identified as "EMF+ Dual" can contain both EMF+ records and EMF records. Either type of record can be used to render the image, only EMF+ records, or only EMF records. When #Error Cref: !:EmfRenderSetting.EmfPlusPrefer is set, then EMF+ records will be parsed while rendering to pdf, otherwise only EMF records will be parsed. Default value is #Error Cref: !:EmfRenderSetting.EmfOnly.

    setDisplayDocTitle

    public voidsetDisplayDocTitle(booleanvalue)
    
    Indicate whether the window's title bar should display the document title. If false, the title bar should instead display the name of the PDF file. Default value is false.

    setClearData

    public voidsetClearData(booleanvalue)
    
    Make the workbook empty after saving the file.

    setCachedFileFolder

    public voidsetCachedFileFolder(java.lang.Stringvalue)
    
    The cached file folder is used to store some large data.

    setValidateMergedAreas

    public voidsetValidateMergedAreas(booleanvalue)
    
    Indicates whether validate merged cells before saving the file. The default value is false.

    setMergeAreas

    public voidsetMergeAreas(booleanvalue)
    
    Indicates whether merge the areas of conditional formatting and validation before saving the file. The default value is false.

    setCreateDirectory

    public voidsetCreateDirectory(booleanvalue)
    
    If true and the directory does not exist, the directory will be automatically created before saving the file. The default value is false.

    setSortNames

    public voidsetSortNames(booleanvalue)
    
    Indicates whether sorting defined names before saving file.

    setRefreshChartCache

    public voidsetRefreshChartCache(booleanvalue)
    
    Indicates whether refreshing chart cache data

    setPdfExportImagesFolder

    public voidsetPdfExportImagesFolder(java.lang.Stringvalue)
    
    The physical folder where images will be saved when exporting a workbook to Aspose.Pdf XML format. Default is an empty string.

    setEnableHTTPCompression

    public voidsetEnableHTTPCompression(booleanvalue)
    
    Indicates if http compression is to be used in user's IIS. Please specify this property to true if http compression is used.

    setWarningCallback

    public voidsetWarningCallback(IWarningCallback value)
    
    Gets or sets warning callback.
    • Method Detail

      • setImageResample

        public void setImageResample(int desiredPPI, int jpegQuality)
        Set desired PPI(pixels per inch) of resample images and jpeg quality All images will be converted to JPEG with the specified quality setting, and images that are greater than the specified PPI (pixels per inch) will be resampled.
        Parameters:
        desiredPPI - Desired pixels per inch. 220 high quality. 150 screen quality. 96 email quality.
        jpegQuality - 0 - 100% JPEG quality.