java.lang.ObjectSaveOptions
PaginatedSaveOptions
com.aspose.cells.PdfSaveOptions
public class PdfSaveOptions
Example:
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);
| Constructor Summary |
|---|
PdfSaveOptions()
Creates the options for saving pdf file. |
| Property Getters/Setters Summary | ||
|---|---|---|
boolean | getAllColumnsInOnePagePerSheet() | → inherited from PaginatedSaveOptions
|
void | setAllColumnsInOnePagePerSheet(boolean) | |
| 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. | ||
PdfBookmarkEntry | getBookmark() | |
void | setBookmark(PdfBookmarkEntry) | |
|
Gets and sets the |
||
java.lang.String | getCachedFileFolder() | → inherited from SaveOptions
|
void | setCachedFileFolder(java.lang.String) | |
| The cached file folder is used to store some large data. | ||
boolean | getCalculateFormula() | |
void | setCalculateFormula(boolean) | |
| Indicates whether to calculate formulas before saving pdf file. | ||
boolean | getCheckFontCompatibility() | → inherited from PaginatedSaveOptions
|
void | setCheckFontCompatibility(boolean) | |
| Indicates whether to check font compatibility for every character in text. | ||
boolean | getCheckWorkbookDefaultFont() | → inherited from PaginatedSaveOptions
|
void | setCheckWorkbookDefaultFont(boolean) | |
| 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. | ||
boolean | getClearData() | → inherited from SaveOptions
|
void | setClearData(boolean) | |
| Make the workbook empty after saving the file. | ||
int | getCompliance() | |
void | setCompliance(int) | |
| Workbook converts to pdf will according to PdfCompliance in this property. The value of the property is PdfCompliance integer constant. | ||
boolean | getCreateDirectory() | → inherited from SaveOptions
|
void | setCreateDirectory(boolean) | |
| If true and the directory does not exist, the directory will be automatically created before saving the file. | ||
com.aspose.cells.DateTime | getCreatedTime() | |
void | setCreatedTime(com.aspose.cells.DateTime) | |
| Gets and sets the time of generating the pdf document. | ||
int | getCustomPropertiesExport() | |
void | setCustomPropertiesExport(int) | |
|
Gets or sets a value determining the way |
||
int | getDefaultEditLanguage() | → inherited from PaginatedSaveOptions
|
void | setDefaultEditLanguage(int) | |
| Gets or sets default edit language. The value of the property is DefaultEditLanguage integer constant. | ||
java.lang.String | getDefaultFont() | → inherited from PaginatedSaveOptions
|
void | setDefaultFont(java.lang.String) | |
| 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. | ||
boolean | getDisplayDocTitle() | |
void | setDisplayDocTitle(boolean) | |
| Indicates whether the window's title bar should display the document title. | ||
DrawObjectEventHandler | getDrawObjectEventHandler() | → inherited from PaginatedSaveOptions
|
void | setDrawObjectEventHandler(DrawObjectEventHandler) | |
| Implements this interface to get DrawObject and Bound when rendering. | ||
boolean | getEmbedStandardWindowsFonts() | |
void | setEmbedStandardWindowsFonts(boolean) | |
| 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. | ||
int | getEmfRenderSetting() | |
void | setEmfRenderSetting(int) | |
| Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. | ||
boolean | getExportDocumentStructure() | |
void | setExportDocumentStructure(boolean) | |
| Indicates whether to export document structure. | ||
int | getFontEncoding() | |
void | setFontEncoding(int) | |
| Gets or sets embedded font encoding in pdf. The value of the property is PdfFontEncoding integer constant. | ||
int | getGridlineType() | → inherited from PaginatedSaveOptions
|
void | setGridlineType(int) | |
| Gets or sets gridline type. The value of the property is GridlineType integer constant. | ||
boolean | getIgnoreError() | → inherited from PaginatedSaveOptions
|
void | setIgnoreError(boolean) | |
| Indicates if you need to hide the error while rendering. The error can be error in shape, image, chart rendering, etc. | ||
com.aspose.cells.ImageFormat | getImageType() | |
void | setImageType(com.aspose.cells.ImageFormat) | |
| Represents the image type when converting the chart and shape . | ||
boolean | isFontSubstitutionCharGranularity() | → inherited from PaginatedSaveOptions
|
void | setFontSubstitutionCharGranularity(boolean) | |
| Indicates whether to only substitute the font of character when the cell font is not compatibility for it. | ||
boolean | getMergeAreas() | → inherited from SaveOptions
|
void | setMergeAreas(boolean) | |
| Indicates whether merge the areas of conditional formatting and validation before saving the file. | ||
boolean | getOnePagePerSheet() | → inherited from PaginatedSaveOptions
|
void | setOnePagePerSheet(boolean) | |
| 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. | ||
int | getOptimizationType() | |
void | setOptimizationType(int) | |
| Gets and sets pdf optimization type. The value of the property is PdfOptimizationType integer constant. | ||
boolean | getOutputBlankPageWhenNothingToPrint() | → inherited from PaginatedSaveOptions
|
void | setOutputBlankPageWhenNothingToPrint(boolean) | |
| Indicates whether to output a blank page when there is nothing to print. | ||
int | getPageCount() | → inherited from PaginatedSaveOptions
|
void | setPageCount(int) | |
| Gets or sets the number of pages to save. | ||
int | getPageIndex() | → inherited from PaginatedSaveOptions
|
void | setPageIndex(int) | |
| Gets or sets the 0-based index of the first page to save. | ||
IPageSavingCallback | getPageSavingCallback() | → inherited from PaginatedSaveOptions
|
void | setPageSavingCallback(IPageSavingCallback) | |
| Control/Indicate progress of page saving process. | ||
int | getPdfCompression() | |
void | setPdfCompression(int) | |
| Indicate the compression algorithm The value of the property is PdfCompressionCore integer constant. | ||
int | getPrintingPageType() | → inherited from PaginatedSaveOptions
|
void | setPrintingPageType(int) | |
| Indicates which pages will not be printed. The value of the property is PrintingPageType integer constant. | ||
java.lang.String | getProducer() | |
void | setProducer(java.lang.String) | |
| Gets and sets producer of generated pdf document. | ||
boolean | getRefreshChartCache() | → inherited from SaveOptions
|
void | setRefreshChartCache(boolean) | |
| Indicates whether refreshing chart cache data | ||
int | getSaveFormat() | → inherited from SaveOptions
|
| Gets the save file format. The value of the property is SaveFormat integer constant. | ||
PdfSecurityOptions | getSecurityOptions() | |
void | setSecurityOptions(PdfSecurityOptions) | |
| Set this options, when security is need in xls2pdf result. | ||
SheetSet | getSheetSet() | → inherited from PaginatedSaveOptions
|
void | setSheetSet(SheetSet) | |
|
Gets or sets the sheets to render. Default is all visible sheets in the workbook: |
||
boolean | getSortExternalNames() | → inherited from SaveOptions
|
void | setSortExternalNames(boolean) | |
| Indicates whether sorting external defined names before saving file. | ||
boolean | getSortNames() | → inherited from SaveOptions
|
void | setSortNames(boolean) | |
| Indicates whether sorting defined names before saving file. | ||
int | getTextCrossType() | → inherited from PaginatedSaveOptions
|
void | setTextCrossType(int) | |
| Gets or sets displaying text type when the text width is larger than cell width. The value of the property is TextCrossType integer constant. | ||
boolean | getUpdateSmartArt() | → inherited from SaveOptions
|
void | setUpdateSmartArt(boolean) | |
| Indicates whether updating smart art setting. The default value is false. | ||
boolean | getValidateMergedAreas() | → inherited from SaveOptions
|
void | setValidateMergedAreas(boolean) | |
| Indicates whether validate merged cells before saving the file. | ||
IWarningCallback | getWarningCallback() | → inherited from SaveOptions
|
void | setWarningCallback(IWarningCallback) | |
| Gets or sets warning callback. | ||
| Method Summary | ||
|---|---|---|
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. | ||
| Constructor Detail |
|---|
public PdfSaveOptions()
| Property Getters/Setters Detail |
|---|
getEmbedStandardWindowsFonts/setEmbedStandardWindowsFonts | |
public boolean getEmbedStandardWindowsFonts() / public void setEmbedStandardWindowsFonts(boolean value) | |
getBookmark/setBookmark | |
public PdfBookmarkEntry getBookmark() / public void setBookmark(PdfBookmarkEntry value) | |
getCompliance/setCompliance | |
public int getCompliance() / public void setCompliance(int value) | |
getSecurityOptions/setSecurityOptions | |
public PdfSecurityOptions getSecurityOptions() / public void setSecurityOptions(PdfSecurityOptions value) | |
getImageType/setImageType | |
public com.aspose.cells.ImageFormat getImageType() / public void setImageType(com.aspose.cells.ImageFormat value) | |
getCalculateFormula/setCalculateFormula | |
public boolean getCalculateFormula() / public void setCalculateFormula(boolean value) | |
getPdfCompression/setPdfCompression | |
public int getPdfCompression() / public void setPdfCompression(int value) | |
getCreatedTime/setCreatedTime | |
public com.aspose.cells.DateTime getCreatedTime() / public void setCreatedTime(com.aspose.cells.DateTime value) | |
getProducer/setProducer | |
public java.lang.String getProducer() / public void setProducer(java.lang.String value) | |
getOptimizationType/setOptimizationType | |
public int getOptimizationType() / public void setOptimizationType(int value) | |
getCustomPropertiesExport/setCustomPropertiesExport | |
public int getCustomPropertiesExport() / public void setCustomPropertiesExport(int value) | |
getExportDocumentStructure/setExportDocumentStructure | |
public boolean getExportDocumentStructure() / public void setExportDocumentStructure(boolean value) | |
getEmfRenderSetting/setEmfRenderSetting | |
public int getEmfRenderSetting() / public void setEmfRenderSetting(int value) | |
getDisplayDocTitle/setDisplayDocTitle | |
public boolean getDisplayDocTitle() / public void setDisplayDocTitle(boolean value) | |
getFontEncoding/setFontEncoding | |
public int getFontEncoding() / public void setFontEncoding(int value) | |
getDefaultFont/setDefaultFont | → inherited from PaginatedSaveOptions
|
public java.lang.String getDefaultFont() / public void setDefaultFont(java.lang.String value) | |
getCheckWorkbookDefaultFont/setCheckWorkbookDefaultFont | → inherited from PaginatedSaveOptions
|
public boolean getCheckWorkbookDefaultFont() / public void setCheckWorkbookDefaultFont(boolean value) | |
getCheckFontCompatibility/setCheckFontCompatibility | → inherited from PaginatedSaveOptions
|
public boolean getCheckFontCompatibility() / public void setCheckFontCompatibility(boolean value) | |
isFontSubstitutionCharGranularity/setFontSubstitutionCharGranularity | → inherited from PaginatedSaveOptions
|
public boolean isFontSubstitutionCharGranularity() / public void setFontSubstitutionCharGranularity(boolean value) | |
getOnePagePerSheet/setOnePagePerSheet | → inherited from PaginatedSaveOptions
|
public boolean getOnePagePerSheet() / public void setOnePagePerSheet(boolean value) | |
getAllColumnsInOnePagePerSheet/setAllColumnsInOnePagePerSheet | → inherited from PaginatedSaveOptions
|
public boolean getAllColumnsInOnePagePerSheet() / public void setAllColumnsInOnePagePerSheet(boolean value) | |
getIgnoreError/setIgnoreError | → inherited from PaginatedSaveOptions
|
public boolean getIgnoreError() / public void setIgnoreError(boolean value) | |
getOutputBlankPageWhenNothingToPrint/setOutputBlankPageWhenNothingToPrint | → inherited from PaginatedSaveOptions
|
public boolean getOutputBlankPageWhenNothingToPrint() / public void setOutputBlankPageWhenNothingToPrint(boolean value) | |
getPageIndex/setPageIndex | → inherited from PaginatedSaveOptions
|
public int getPageIndex() / public void setPageIndex(int value) | |
getPageCount/setPageCount | → inherited from PaginatedSaveOptions
|
public int getPageCount() / public void setPageCount(int value) | |
Example:
//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);getPrintingPageType/setPrintingPageType | → inherited from PaginatedSaveOptions
|
public int getPrintingPageType() / public void setPrintingPageType(int value) | |
Example:
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);getGridlineType/setGridlineType | → inherited from PaginatedSaveOptions
|
public int getGridlineType() / public void setGridlineType(int value) | |
getTextCrossType/setTextCrossType | → inherited from PaginatedSaveOptions
|
public int getTextCrossType() / public void setTextCrossType(int value) | |
getDefaultEditLanguage/setDefaultEditLanguage | → inherited from PaginatedSaveOptions
|
public int getDefaultEditLanguage() / public void setDefaultEditLanguage(int value) | |
getSheetSet/setSheetSet | → inherited from PaginatedSaveOptions
|
public SheetSet getSheetSet() / public void setSheetSet(SheetSet value) | |
getDrawObjectEventHandler/setDrawObjectEventHandler | → inherited from PaginatedSaveOptions
|
public DrawObjectEventHandler getDrawObjectEventHandler() / public void setDrawObjectEventHandler(DrawObjectEventHandler value) | |
getPageSavingCallback/setPageSavingCallback | → inherited from PaginatedSaveOptions
|
public IPageSavingCallback getPageSavingCallback() / public void setPageSavingCallback(IPageSavingCallback value) | |
getSaveFormat | → inherited from SaveOptions
|
public int getSaveFormat() | |
getClearData/setClearData | → inherited from SaveOptions
|
public boolean getClearData() / public void setClearData(boolean value) | |
getCachedFileFolder/setCachedFileFolder | → inherited from SaveOptions
|
public java.lang.String getCachedFileFolder() / public void setCachedFileFolder(java.lang.String value) | |
getValidateMergedAreas/setValidateMergedAreas | → inherited from SaveOptions
|
public boolean getValidateMergedAreas() / public void setValidateMergedAreas(boolean value) | |
getMergeAreas/setMergeAreas | → inherited from SaveOptions
|
public boolean getMergeAreas() / public void setMergeAreas(boolean value) | |
getCreateDirectory/setCreateDirectory | → inherited from SaveOptions
|
public boolean getCreateDirectory() / public void setCreateDirectory(boolean value) | |
getSortNames/setSortNames | → inherited from SaveOptions
|
public boolean getSortNames() / public void setSortNames(boolean value) | |
getSortExternalNames/setSortExternalNames | → inherited from SaveOptions
|
public boolean getSortExternalNames() / public void setSortExternalNames(boolean value) | |
getRefreshChartCache/setRefreshChartCache | → inherited from SaveOptions
|
public boolean getRefreshChartCache() / public void setRefreshChartCache(boolean value) | |
getWarningCallback/setWarningCallback | → inherited from SaveOptions
|
public IWarningCallback getWarningCallback() / public void setWarningCallback(IWarningCallback value) | |
getUpdateSmartArt/setUpdateSmartArt | → inherited from SaveOptions
|
public boolean getUpdateSmartArt() / public void setUpdateSmartArt(boolean value) | |
| Method Detail |
|---|
setImageResample | |
public void setImageResample(int desiredPPI, int jpegQuality) | |
desiredPPI - Desired pixels per inch. 220 high quality. 150 screen quality. 96 email quality.jpegQuality - 0 - 100% JPEG quality.Example:
//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);