PdfSaveOptions

Inheritance: java.lang.Object, com.aspose.cells.SaveOptions, com.aspose.cells.PaginatedSaveOptions

public class PdfSaveOptions extends PaginatedSaveOptions

Represents the options for saving pdf file.

Constructors

ConstructorDescription
PdfSaveOptions()Creates the options for saving pdf file.

Methods

MethodDescription
equals(Object arg0)
getAllColumnsInOnePagePerSheet()If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result.
getBookmark()Gets the PdfBookmarkEntry object.
getCachedFileFolder()The cached file folder is used to store some large data.
getCalculateFormula()Indicates whether to calculate formulas before saving pdf file.
getCheckFontCompatibility()Indicates whether to check font compatibility for every character in text.
getCheckWorkbookDefaultFont()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.
getClass()
getClearData()Make the workbook empty after saving the file.
getCompliance()Gets the PDF standards compliance level for output documents.
getCreateDirectory()If true and the directory does not exist, the directory will be automatically created before saving the file.
getCreatedTime()Gets the time of generating the pdf document.
getCustomPropertiesExport()Gets a value determining the way CustomDocumentPropertyCollection are exported to PDF file.
getDefaultEditLanguage()Gets default edit language.
getDefaultFont()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.
getDisplayDocTitle()Indicates whether the window’s title bar should display the document title.
getDrawObjectEventHandler()Implements this interface to get DrawObject and Bound when rendering.
getEmbedStandardWindowsFonts()True to embed true type fonts.
getEmfRenderSetting()Setting for rendering Emf metafile.
getExportDocumentStructure()Indicates whether to export document structure.
getFontEncoding()Gets embedded font encoding in pdf.
getGridlineType()Gets gridline type.
getIgnoreError()Indicates if you need to hide the error while rendering.
getImageType()Represents the image type when converting the chart and shape .
getMergeAreas()Indicates whether merge the areas of conditional formatting and validation before saving the file.
getOnePagePerSheet()If OnePagePerSheet is true , all content of one sheet will output to only one page in result.
getOptimizationType()Gets pdf optimization type.
getOutputBlankPageWhenNothingToPrint()Indicates whether to output a blank page when there is nothing to print.
getPageCount()Gets the number of pages to save.
getPageIndex()Gets the 0-based index of the first page to save.
getPageSavingCallback()Control/Indicate progress of page saving process.
getPdfCompression()Indicate the compression algorithm
getPrintingPageType()Indicates which pages will not be printed.
getProducer()Gets producer of generated pdf document.
getRefreshChartCache()Indicates whether refreshing chart cache data
getSaveFormat()Gets the save file format.
getSecurityOptions()Set this options, when security is need in xls2pdf result.
getSheetSet()Gets the sheets to render.
getSortExternalNames()Indicates whether sorting external defined names before saving file.
getSortNames()Indicates whether sorting defined names before saving file.
getTextCrossType()Gets displaying text type when the text width is larger than cell width.
getUpdateSmartArt()Indicates whether updating smart art setting.
getValidateMergedAreas()Indicates whether validate merged cells before saving the file.
getWarningCallback()Gets warning callback.
getWatermark()Gets watermark to output.
hashCode()
isFontSubstitutionCharGranularity()Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
notify()
notifyAll()
setAllColumnsInOnePagePerSheet(boolean value)If AllColumnsInOnePagePerSheet is true , all column content of one sheet will output to only one page in result.
setBookmark(PdfBookmarkEntry value)Sets the PdfBookmarkEntry object.
setCachedFileFolder(String value)The cached file folder is used to store some large data.
setCalculateFormula(boolean value)Indicates whether to calculate formulas before saving pdf file.
setCheckFontCompatibility(boolean value)Indicates whether to check font compatibility for every character in text.
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.
setClearData(boolean value)Make the workbook empty after saving the file.
setCompliance(int value)Sets the PDF standards compliance level for output documents.
setCreateDirectory(boolean value)If true and the directory does not exist, the directory will be automatically created before saving the file.
setCreatedTime(DateTime value)Sets the time of generating the pdf document.
setCustomPropertiesExport(int value)Sets a value determining the way CustomDocumentPropertyCollection are exported to PDF file.
setDefaultEditLanguage(int value)Sets default edit language.
setDefaultFont(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.
setDisplayDocTitle(boolean value)Indicates whether the window’s title bar should display the document title.
setDrawObjectEventHandler(DrawObjectEventHandler value)Implements this interface to get DrawObject and Bound when rendering.
setEmbedStandardWindowsFonts(boolean value)True to embed true type fonts.
setEmfRenderSetting(int value)Setting for rendering Emf metafile.
setExportDocumentStructure(boolean value)Indicates whether to export document structure.
setFontEncoding(int value)Sets embedded font encoding in pdf.
setFontSubstitutionCharGranularity(boolean value)Indicates whether to only substitute the font of character when the cell font is not compatibility for it.
setGridlineType(int value)Sets gridline type.
setIgnoreError(boolean value)Indicates if you need to hide the error while rendering.
setImageResample(int desiredPPI, int jpegQuality)Sets desired PPI(pixels per inch) of resample images and jpeg quality.
setImageType(ImageFormat value)Represents the image type when converting the chart and shape .
setMergeAreas(boolean value)Indicates whether merge the areas of conditional formatting and validation before saving the file.
setOnePagePerSheet(boolean value)If OnePagePerSheet is true , all content of one sheet will output to only one page in result.
setOptimizationType(int value)Sets pdf optimization type.
setOutputBlankPageWhenNothingToPrint(boolean value)Indicates whether to output a blank page when there is nothing to print.
setPageCount(int value)Sets the number of pages to save.
setPageIndex(int value)Sets the 0-based index of the first page to save.
setPageSavingCallback(IPageSavingCallback value)Control/Indicate progress of page saving process.
setPdfCompression(int value)Indicate the compression algorithm
setPrintingPageType(int value)Indicates which pages will not be printed.
setProducer(String value)Sets producer of generated pdf document.
setRefreshChartCache(boolean value)Indicates whether refreshing chart cache data
setSecurityOptions(PdfSecurityOptions value)Set this options, when security is need in xls2pdf result.
setSheetSet(SheetSet value)Sets the sheets to render.
setSortExternalNames(boolean value)Indicates whether sorting external defined names before saving file.
setSortNames(boolean value)Indicates whether sorting defined names before saving file.
setTextCrossType(int value)Sets displaying text type when the text width is larger than cell width.
setUpdateSmartArt(boolean value)Indicates whether updating smart art setting.
setValidateMergedAreas(boolean value)Indicates whether validate merged cells before saving the file.
setWarningCallback(IWarningCallback value)Sets warning callback.
setWatermark(RenderingWatermark value)Sets watermark to output.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

PdfSaveOptions()

public PdfSaveOptions()

Creates the options for saving pdf file.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAllColumnsInOnePagePerSheet()

public boolean getAllColumnsInOnePagePerSheet()

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.

Returns: boolean

getBookmark()

public PdfBookmarkEntry getBookmark()

Gets the PdfBookmarkEntry object.

Returns: PdfBookmarkEntry

getCachedFileFolder()

public String getCachedFileFolder()

The cached file folder is used to store some large data.

Returns: java.lang.String

getCalculateFormula()

public boolean getCalculateFormula()

Indicates whether to calculate formulas before saving pdf file.

Remarks

The default value is false.

Returns: boolean

getCheckFontCompatibility()

public boolean getCheckFontCompatibility()

Indicates whether to check font compatibility for every character in text.

Remarks

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;

Returns: boolean

getCheckWorkbookDefaultFont()

public boolean getCheckWorkbookDefaultFont()

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.

Remarks

Default is true.

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getClearData()

public boolean getClearData()

Make the workbook empty after saving the file.

Returns: boolean

getCompliance()

public int getCompliance()

Gets the PDF standards compliance level for output documents.

See PdfCompliance.

Remarks

Default is Pdf17.

Returns: int

getCreateDirectory()

public boolean getCreateDirectory()

If true and the directory does not exist, the directory will be automatically created before saving the file.

Remarks

The default value is false.

Returns: boolean

getCreatedTime()

public DateTime getCreatedTime()

Gets the time of generating the pdf document.

Remarks

if it is not be set, it will be the time of generating the pdf.

Returns: DateTime

getCustomPropertiesExport()

public int getCustomPropertiesExport()

Gets a value determining the way CustomDocumentPropertyCollection are exported to PDF file. Default value is None.

See PdfCustomPropertiesExport.

Returns: int

getDefaultEditLanguage()

public int getDefaultEditLanguage()

Gets default edit language.

See DefaultEditLanguage.

Remarks

It may display/render different layouts for text paragraph when different edit languages is set. Default is DefaultEditLanguage.AUTO.

Returns: int

getDefaultFont()

public String getDefaultFont()

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.

Returns: java.lang.String

getDisplayDocTitle()

public boolean getDisplayDocTitle()

Indicates whether the window’s title bar should display the document title.

Remarks

If false, the title bar should instead display the name of the PDF file. Default value is false.

Returns: boolean

getDrawObjectEventHandler()

public DrawObjectEventHandler getDrawObjectEventHandler()

Implements this interface to get DrawObject and Bound when rendering.

Returns: DrawObjectEventHandler

getEmbedStandardWindowsFonts()

public boolean getEmbedStandardWindowsFonts()

True to embed true type fonts. Affects only ASCII characters 32-127. Fonts for character codes greater than 127 are always embedded. Fonts are always embedded for PDF/A-1a, PDF/A-1b standard. Default is true.

Returns: boolean

getEmfRenderSetting()

public int getEmfRenderSetting()

Setting for rendering Emf metafile.

See EmfRenderSetting.

Remarks

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 EmfRenderSetting.EMF_PLUS_PREFER is set, then EMF+ records will be parsed while rendering to page, otherwise only EMF records will be parsed. Default value is EmfRenderSetting.EMF_ONLY.

Returns: int

getExportDocumentStructure()

public boolean getExportDocumentStructure()

Indicates whether to export document structure.

Returns: boolean

getFontEncoding()

public int getFontEncoding()

Gets embedded font encoding in pdf.

See PdfFontEncoding.

Remarks

Default value is PdfFontEncoding.IDENTITY

Returns: int

getGridlineType()

public int getGridlineType()

Gets gridline type.

See GridlineType.

Remarks

Default is Dotted type.

Returns: int

getIgnoreError()

public boolean getIgnoreError()

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

Returns: boolean

getImageType()

public ImageFormat getImageType()

Represents the image type when converting the chart and shape .

Remarks

NOTE: This member is now obsolete. Instead, Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality. This property will be removed 12 months later since June 2022. Aspose apologizes for any inconvenience you may have experienced.

Returns: ImageFormat

getMergeAreas()

public boolean getMergeAreas()

Indicates whether merge the areas of conditional formatting and validation before saving the file.

Remarks

The default value is false.

Returns: boolean

getOnePagePerSheet()

public boolean getOnePagePerSheet()

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.

Returns: boolean

getOptimizationType()

public int getOptimizationType()

Gets pdf optimization type.

See PdfOptimizationType.

Remarks

Default value is PdfOptimizationType.STANDARD

Returns: int

getOutputBlankPageWhenNothingToPrint()

public boolean getOutputBlankPageWhenNothingToPrint()

Indicates whether to output a blank page when there is nothing to print.

Remarks

Default is true.

Returns: boolean

getPageCount()

public int getPageCount()

Gets the number of pages to save.

Remarks

Default is System.Int32.MaxValue which means all pages will be rendered..

Example

The following example shows how to render a range of pages (3 and 4) in a Microsoft Excel file to PDF.

         //Open an Excel file
         Workbook wb = new Workbook("Book1.xlsx");
 
         PdfSaveOptions options = new PdfSaveOptions();
 
         //Print only Page 3 and Page 4 in the output PDF
         //Starting page index (0-based index)
         options.setPageIndex(3);
         //Number of pages to be printed
         options.setPageCount(2);
 
         //Save the PDF file
         wb.save("output.pdf", options);

Returns: int

getPageIndex()

public int getPageIndex()

Gets the 0-based index of the first page to save.

Remarks

Default is 0.

Example

The following example shows how to render a range of pages (3 and 4) in a Microsoft Excel file to PDF.

         //Open an Excel file
         Workbook wb = new Workbook("Book1.xlsx");
 
         PdfSaveOptions options = new PdfSaveOptions();
 
         //Print only Page 3 and Page 4 in the output PDF
         //Starting page index (0-based index)
         options.setPageIndex(3);
         //Number of pages to be printed
         options.setPageCount(2);
 
         //Save the PDF file
         wb.save("output.pdf", options);

Returns: int

getPageSavingCallback()

public IPageSavingCallback getPageSavingCallback()

Control/Indicate progress of page saving process.

Returns: IPageSavingCallback

getPdfCompression()

public int getPdfCompression()

Indicate the compression algorithm

See PdfCompressionCore.

Returns: int

getPrintingPageType()

public int getPrintingPageType()

Indicates which pages will not be printed.

See PrintingPageType.

Remarks

If content in the sheet is sparse, there will be some pages are totally blank in the output pdf file. If you don’t want these blank pages, you can use this option to omit them.

Example

The following code omits blank pages or pages which only contains some style content like cell background, borders.

         Workbook wb = new Workbook("Book1.xlsx");
 
         PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
 
         //ignore blank pages
         pdfSaveOptions.setPrintingPageType(PrintingPageType.IGNORE_BLANK);
 
         wb.save("output_ignore_blank_page.pdf", pdfSaveOptions);
 
 
         //ignore blank pages and pages which only contains some style content like cell background
         pdfSaveOptions.setPrintingPageType(PrintingPageType.IGNORE_STYLE);
 
         wb.save("output_ignore_blank_and_style_page.pdf", pdfSaveOptions);

Returns: int

getProducer()

public String getProducer()

Gets producer of generated pdf document.

Remarks

If the value is null, or a valid LICENSE is not set, string Aspose.Cells vVERSION will be used.

Returns: java.lang.String

getRefreshChartCache()

public boolean getRefreshChartCache()

Indicates whether refreshing chart cache data

Returns: boolean

getSaveFormat()

public int getSaveFormat()

Gets the save file format.

See SaveFormat.

Returns: int

getSecurityOptions()

public PdfSecurityOptions getSecurityOptions()

Set this options, when security is need in xls2pdf result.

Example

The following code sets hight resolution print permisson for the output pdf.

         Workbook wb = new Workbook();
         wb.getWorksheets().get(0).getCells().get("A1").setValue("Aspose");
 
         PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
 
 
         PdfSecurityOptions pdfSecurityOptions = new PdfSecurityOptions();
 
         //set owner password
         pdfSecurityOptions.setOwnerPassword("YourOwnerPassword");
 
         //set user password
         pdfSecurityOptions.setUserPassword("YourUserPassword");
 
         //set print permisson
         pdfSecurityOptions.setPrintPermission(true);
 
         //set high resolution for print
         pdfSecurityOptions.setFullQualityPrintPermission(true);
 
 
         pdfSaveOptions.setSecurityOptions(pdfSecurityOptions);
 
         wb.save("output.pdf", pdfSaveOptions);

Returns: PdfSecurityOptions

getSheetSet()

public SheetSet getSheetSet()

Gets the sheets to render. Default is all visible sheets in the workbook: SheetSet.getVisible().

Example

The following code only renders active sheet to pdf.

         Workbook workbook = new Workbook("Book1.xlsx");
 
         int activeSheetIndex = workbook.getWorksheets().getActiveSheetIndex();
 
         PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
         //set active sheet index to sheet set.
         pdfSaveOptions.setSheetSet(new SheetSet(new int[] { activeSheetIndex }));
         workbook.save("output.pdf", pdfSaveOptions);

Returns: SheetSet

getSortExternalNames()

public boolean getSortExternalNames()

Indicates whether sorting external defined names before saving file.

Returns: boolean

getSortNames()

public boolean getSortNames()

Indicates whether sorting defined names before saving file.

Returns: boolean

getTextCrossType()

public int getTextCrossType()

Gets displaying text type when the text width is larger than cell width.

See TextCrossType.

Returns: int

getUpdateSmartArt()

public boolean getUpdateSmartArt()

Indicates whether updating smart art setting. The default value is false.

Remarks

Only effects after calling Shape.GetResultOfSmartArt() method and the cached shapes exist in the template file.

Returns: boolean

getValidateMergedAreas()

public boolean getValidateMergedAreas()

Indicates whether validate merged cells before saving the file.

Remarks

The default value is false.

Returns: boolean

getWarningCallback()

public IWarningCallback getWarningCallback()

Gets warning callback.

Returns: IWarningCallback

getWatermark()

public RenderingWatermark getWatermark()

Gets watermark to output.

Example

The following code sets watermark in the output pdf.

         //prepare a workbook with 3 pages.
         Workbook wb = new Workbook();
         wb.getWorksheets().get(0).getCells().get("A1").putValue("Page1");
         int index = wb.getWorksheets().add();
         wb.getWorksheets().get(index).getCells().get("A1").putValue("Page2");
         index = wb.getWorksheets().add();
         wb.getWorksheets().get(index).getCells().get("A1").putValue("Page3");
         wb.getWorksheets().get(index).getPageSetup().setPaperSize(PaperSizeType.PAPER_A_3);
 
         //create a font for watermark, and specify bold, italic, color
         RenderingFont font = new RenderingFont("Calibri", 68);
         font.setItalic(true);
         font.setBold(true);
         font.setColor(Color.getBlue());
 
         //create a watermark from text and the specified font
         RenderingWatermark watermark = new RenderingWatermark("Watermark", font);
 
         //specify horizontal and vertical alignment
         watermark.setHAlignment(TextAlignmentType.CENTER);
         watermark.setVAlignment(TextAlignmentType.CENTER);
 
         //specify rotation
         watermark.setRotation(30);
 
         //specify opacity
         watermark.setOpacity(0.6f);
 
         //specify the scale to page(e.g. 100, 50) in percent.
         watermark.setScaleToPagePercent(50);
 
         //spcify watermark for rendering to pdf.
         PdfSaveOptions options = new PdfSaveOptions();
         options.setWatermark(watermark);
 
         wb.save("output_watermark.pdf", options);

Returns: RenderingWatermark

hashCode()

public native int hashCode()

Returns: int

isFontSubstitutionCharGranularity()

public boolean isFontSubstitutionCharGranularity()

Indicates whether to only substitute the font of character when the cell font is not compatibility for it.

Remarks

Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.

Returns: boolean

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAllColumnsInOnePagePerSheet(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setBookmark(PdfBookmarkEntry value)

public void setBookmark(PdfBookmarkEntry value)

Sets the PdfBookmarkEntry object.

Parameters:

ParameterTypeDescription
valuePdfBookmarkEntry

setCachedFileFolder(String value)

public void setCachedFileFolder(String value)

The cached file folder is used to store some large data.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setCalculateFormula(boolean value)

public void setCalculateFormula(boolean value)

Indicates whether to calculate formulas before saving pdf file.

Remarks

The default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setCheckFontCompatibility(boolean value)

public void setCheckFontCompatibility(boolean value)

Indicates whether to check font compatibility for every character in text.

Remarks

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;

Parameters:

ParameterTypeDescription
valueboolean

setCheckWorkbookDefaultFont(boolean value)

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.

Remarks

Default is true.

Parameters:

ParameterTypeDescription
valueboolean

setClearData(boolean value)

public void setClearData(boolean value)

Make the workbook empty after saving the file.

Parameters:

ParameterTypeDescription
valueboolean

setCompliance(int value)

public void setCompliance(int value)

Sets the PDF standards compliance level for output documents.

See PdfCompliance.

Remarks

Default is Pdf17.

Parameters:

ParameterTypeDescription
valueint

setCreateDirectory(boolean value)

public void setCreateDirectory(boolean value)

If true and the directory does not exist, the directory will be automatically created before saving the file.

Remarks

The default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setCreatedTime(DateTime value)

public void setCreatedTime(DateTime value)

Sets the time of generating the pdf document.

Remarks

if it is not be set, it will be the time of generating the pdf.

Parameters:

ParameterTypeDescription
valueDateTime

setCustomPropertiesExport(int value)

public void setCustomPropertiesExport(int value)

Sets a value determining the way CustomDocumentPropertyCollection are exported to PDF file. Default value is None.

See PdfCustomPropertiesExport.

Parameters:

ParameterTypeDescription
valueint

setDefaultEditLanguage(int value)

public void setDefaultEditLanguage(int value)

Sets default edit language.

See DefaultEditLanguage.

Remarks

It may display/render different layouts for text paragraph when different edit languages is set. Default is DefaultEditLanguage.AUTO.

Parameters:

ParameterTypeDescription
valueint

setDefaultFont(String value)

public void setDefaultFont(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.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setDisplayDocTitle(boolean value)

public void setDisplayDocTitle(boolean value)

Indicates whether the window’s title bar should display the document title.

Remarks

If false, the title bar should instead display the name of the PDF file. Default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setDrawObjectEventHandler(DrawObjectEventHandler value)

public void setDrawObjectEventHandler(DrawObjectEventHandler value)

Implements this interface to get DrawObject and Bound when rendering.

Parameters:

ParameterTypeDescription
valueDrawObjectEventHandler

setEmbedStandardWindowsFonts(boolean value)

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. Fonts are always embedded for PDF/A-1a, PDF/A-1b standard. Default is true.

Parameters:

ParameterTypeDescription
valueboolean

setEmfRenderSetting(int value)

public void setEmfRenderSetting(int value)

Setting for rendering Emf metafile.

See EmfRenderSetting.

Remarks

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 EmfRenderSetting.EMF_PLUS_PREFER is set, then EMF+ records will be parsed while rendering to page, otherwise only EMF records will be parsed. Default value is EmfRenderSetting.EMF_ONLY.

Parameters:

ParameterTypeDescription
valueint

setExportDocumentStructure(boolean value)

public void setExportDocumentStructure(boolean value)

Indicates whether to export document structure.

Parameters:

ParameterTypeDescription
valueboolean

setFontEncoding(int value)

public void setFontEncoding(int value)

Sets embedded font encoding in pdf.

See PdfFontEncoding.

Remarks

Default value is PdfFontEncoding.IDENTITY

Parameters:

ParameterTypeDescription
valueint

setFontSubstitutionCharGranularity(boolean value)

public void setFontSubstitutionCharGranularity(boolean value)

Indicates whether to only substitute the font of character when the cell font is not compatibility for it.

Remarks

Default is false. We will try default font of Workbook and PdfSaveOption/system for cell font first.

Parameters:

ParameterTypeDescription
valueboolean

setGridlineType(int value)

public void setGridlineType(int value)

Sets gridline type.

See GridlineType.

Remarks

Default is Dotted type.

Parameters:

ParameterTypeDescription
valueint

setIgnoreError(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setImageResample(int desiredPPI, int jpegQuality)

public void setImageResample(int desiredPPI, int jpegQuality)

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

Example

The following code sets desired PPI as 96 and jpeg quality as 80 for images in the output pdf.

         //load the source file with images.
         Workbook wb = new Workbook("Book1.xlsx");
 
         PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
 
         //set desired PPI as 96 and jpeg quality as 80.
         pdfSaveOptions.setImageResample(96, 80);
 
         wb.save("output.pdf", pdfSaveOptions);

Parameters:

ParameterTypeDescription
desiredPPIintDesired pixels per inch. 220 high quality. 150 screen quality. 96 email quality.
jpegQualityint0 - 100% JPEG quality.

setImageType(ImageFormat value)

public void setImageType(ImageFormat value)

Represents the image type when converting the chart and shape .

Remarks

NOTE: This member is now obsolete. Instead, Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality. This property will be removed 12 months later since June 2022. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueImageFormat

setMergeAreas(boolean value)

public void setMergeAreas(boolean value)

Indicates whether merge the areas of conditional formatting and validation before saving the file.

Remarks

The default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setOnePagePerSheet(boolean value)

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.

Parameters:

ParameterTypeDescription
valueboolean

setOptimizationType(int value)

public void setOptimizationType(int value)

Sets pdf optimization type.

See PdfOptimizationType.

Remarks

Default value is PdfOptimizationType.STANDARD

Parameters:

ParameterTypeDescription
valueint

setOutputBlankPageWhenNothingToPrint(boolean value)

public void setOutputBlankPageWhenNothingToPrint(boolean value)

Indicates whether to output a blank page when there is nothing to print.

Remarks

Default is true.

Parameters:

ParameterTypeDescription
valueboolean

setPageCount(int value)

public void setPageCount(int value)

Sets the number of pages to save.

Remarks

Default is System.Int32.MaxValue which means all pages will be rendered..

Parameters:

ParameterTypeDescription
valueint

setPageIndex(int value)

public void setPageIndex(int value)

Sets the 0-based index of the first page to save.

Remarks

Default is 0.

Parameters:

ParameterTypeDescription
valueint

setPageSavingCallback(IPageSavingCallback value)

public void setPageSavingCallback(IPageSavingCallback value)

Control/Indicate progress of page saving process.

Parameters:

ParameterTypeDescription
valueIPageSavingCallback

setPdfCompression(int value)

public void setPdfCompression(int value)

Indicate the compression algorithm

See PdfCompressionCore.

Parameters:

ParameterTypeDescription
valueint

setPrintingPageType(int value)

public void setPrintingPageType(int value)

Indicates which pages will not be printed.

See PrintingPageType.

Remarks

If content in the sheet is sparse, there will be some pages are totally blank in the output pdf file. If you don’t want these blank pages, you can use this option to omit them.

Parameters:

ParameterTypeDescription
valueint

setProducer(String value)

public void setProducer(String value)

Sets producer of generated pdf document.

Remarks

If the value is null, or a valid LICENSE is not set, string Aspose.Cells vVERSION will be used.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setRefreshChartCache(boolean value)

public void setRefreshChartCache(boolean value)

Indicates whether refreshing chart cache data

Parameters:

ParameterTypeDescription
valueboolean

setSecurityOptions(PdfSecurityOptions value)

public void setSecurityOptions(PdfSecurityOptions value)

Set this options, when security is need in xls2pdf result.

Parameters:

ParameterTypeDescription
valuePdfSecurityOptions

setSheetSet(SheetSet value)

public void setSheetSet(SheetSet value)

Sets the sheets to render. Default is all visible sheets in the workbook: SheetSet.getVisible().

Parameters:

ParameterTypeDescription
valueSheetSet

setSortExternalNames(boolean value)

public void setSortExternalNames(boolean value)

Indicates whether sorting external defined names before saving file.

Parameters:

ParameterTypeDescription
valueboolean

setSortNames(boolean value)

public void setSortNames(boolean value)

Indicates whether sorting defined names before saving file.

Parameters:

ParameterTypeDescription
valueboolean

setTextCrossType(int value)

public void setTextCrossType(int value)

Sets displaying text type when the text width is larger than cell width.

See TextCrossType.

Parameters:

ParameterTypeDescription
valueint

setUpdateSmartArt(boolean value)

public void setUpdateSmartArt(boolean value)

Indicates whether updating smart art setting. The default value is false.

Remarks

Only effects after calling Shape.GetResultOfSmartArt() method and the cached shapes exist in the template file.

Parameters:

ParameterTypeDescription
valueboolean

setValidateMergedAreas(boolean value)

public void setValidateMergedAreas(boolean value)

Indicates whether validate merged cells before saving the file.

Remarks

The default value is false.

Parameters:

ParameterTypeDescription
valueboolean

setWarningCallback(IWarningCallback value)

public void setWarningCallback(IWarningCallback value)

Sets warning callback.

Parameters:

ParameterTypeDescription
valueIWarningCallback

setWatermark(RenderingWatermark value)

public void setWatermark(RenderingWatermark value)

Sets watermark to output.

Parameters:

ParameterTypeDescription
valueRenderingWatermark

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int