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.
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.
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.
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.
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.
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.
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.
Fonts are always embedded for PDF/A-1a, PDF/A-1b standard.
Default is true.
Set this options, when security is need in xls2pdf result.
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 .
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.
getCalculateFormula/setCalculateFormula
public boolean getCalculateFormula() / public void setCalculateFormula(boolean value)
Indicates whether to calculate formulas before saving pdf file.
The default value is false.
getPdfCompression/setPdfCompression
public int getPdfCompression() / public void setPdfCompression(int value)
Indicate the compression algorithm
The value of the property is PdfCompressionCore integer constant.
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.
getProducer/setProducer
public java.lang.String getProducer() / public void setProducer(java.lang.String value)
Gets and sets producer of generated pdf document.
If the value is null, or a valid LICENSE is not set, string Aspose.Cells vVERSION will be used.
getOptimizationType/setOptimizationType
public int getOptimizationType() / public void setOptimizationType(int value)
public boolean getExportDocumentStructure() / public void setExportDocumentStructure(boolean value)
Indicates whether to export document structure.
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 EmfRenderSetting.EMF_PLUS_PREFER is set, then EMF+ records will be parsed while rendering to pdf, otherwise only EMF records will be parsed.
Default value is EmfRenderSetting.EMF_ONLY.
getDisplayDocTitle/setDisplayDocTitle
public boolean getDisplayDocTitle() / public void setDisplayDocTitle(boolean value)
Indicates 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.
getFontEncoding/setFontEncoding
public int getFontEncoding() / public void setFontEncoding(int value)
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.
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.
public boolean getCheckFontCompatibility() / public void setCheckFontCompatibility(boolean value)
Indicates whether to 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;
public boolean isFontSubstitutionCharGranularity() / public void setFontSubstitutionCharGranularity(boolean value)
Indicates whether to 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.
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.
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.
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..
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);
public int getPrintingPageType() / public void setPrintingPageType(int value)
Indicates which pages will not be printed.
The value of the property is PrintingPageType integer constant.
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:
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);
public int getDefaultEditLanguage() / public void setDefaultEditLanguage(int value)
Gets or sets default edit language.
The value of the property is DefaultEditLanguage integer constant.
It may display/render different layouts for text paragraph when different edit languages is set.
Default is DefaultEditLanguage.AUTO.
public boolean getUpdateSmartArt() / public void setUpdateSmartArt(boolean value)
Indicates whether updating smart art setting.
The default value is false.
Only effects after calling Shape.GetResultOfSmartArt() method and the cached shapes exist in the template file.
Method Detail
setImageResample
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.
Parameters:
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);