public class PdfSaveOptions extends PaginatedSaveOptions
| Constructor and Description |
|---|
PdfSaveOptions()
Creates the options for saving pdf file.
|
| Modifier and Type | Method and Description |
|---|---|
PdfBookmarkEntry |
getBookmark()
Gets the
PdfBookmarkEntry object. |
boolean |
getCalculateFormula()
Indicates whether to calculate formulas before saving pdf file.
|
int |
getCompliance()
Gets the PDF standards compliance level for output documents.
|
DateTime |
getCreatedTime()
Gets the time of generating the pdf document.
|
int |
getCustomPropertiesExport()
Gets a value determining the way
CustomDocumentPropertyCollection are exported to PDF file. |
boolean |
getDisplayDocTitle()
Indicates whether the window's title bar should display the document title.
|
boolean |
getEmbedAttachments()
Indicates whether to embed attachment for Ole objects in Excel.
|
boolean |
getEmbedStandardWindowsFonts()
True to embed true type fonts.
|
boolean |
getExportDocumentStructure()
Indicates whether to export document structure.
|
int |
getFontEncoding()
Gets embedded font encoding in pdf.
|
ImageFormat |
getImageType()
Deprecated.
Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality.
|
int |
getOptimizationType()
Gets pdf optimization type.
|
int |
getPdfCompression()
Indicate the compression algorithm
|
java.lang.String |
getProducer()
Gets producer of generated pdf document.
|
PdfSecurityOptions |
getSecurityOptions()
Set this options, when security is need in xls2pdf result.
|
RenderingWatermark |
getWatermark()
Gets watermark to output.
|
void |
setBookmark(PdfBookmarkEntry value)
Sets the
PdfBookmarkEntry object. |
void |
setCalculateFormula(boolean value)
Indicates whether to calculate formulas before saving pdf file.
|
void |
setCompliance(int value)
Sets the PDF standards compliance level for output documents.
|
void |
setCreatedTime(DateTime value)
Sets the time of generating the pdf document.
|
void |
setCustomPropertiesExport(int value)
Sets a value determining the way
CustomDocumentPropertyCollection are exported to PDF file. |
void |
setDisplayDocTitle(boolean value)
Indicates whether the window's title bar should display the document title.
|
void |
setEmbedAttachments(boolean value)
Indicates whether to embed attachment for Ole objects in Excel.
|
void |
setEmbedStandardWindowsFonts(boolean value)
True to embed true type fonts.
|
void |
setExportDocumentStructure(boolean value)
Indicates whether to export document structure.
|
void |
setFontEncoding(int value)
Sets embedded font encoding in pdf.
|
void |
setImageResample(int desiredPPI,
int jpegQuality)
Sets desired PPI(pixels per inch) of resample images and jpeg quality.
|
void |
setImageType(ImageFormat value)
Deprecated.
Chart and Shape are always rendered as vector elements(e.g. point, line) for rendering quality.
|
void |
setOptimizationType(int value)
Sets pdf optimization type.
|
void |
setPdfCompression(int value)
Indicate the compression algorithm
|
void |
setProducer(java.lang.String value)
Sets producer of generated pdf document.
|
void |
setSecurityOptions(PdfSecurityOptions value)
Set this options, when security is need in xls2pdf result.
|
void |
setWatermark(RenderingWatermark value)
Sets watermark to output.
|
getAllColumnsInOnePagePerSheet, getCheckFontCompatibility, getCheckWorkbookDefaultFont, getCustomRenderSettings, getDefaultEditLanguage, getDefaultFont, getDrawObjectEventHandler, getEmfRenderSetting, getGridlineColor, getGridlineType, getIgnoreError, getOnePagePerSheet, getOutputBlankPageWhenNothingToPrint, getPageCount, getPageIndex, getPageSavingCallback, getPrintingPageType, getSheetSet, getTextCrossType, isFontSubstitutionCharGranularity, setAllColumnsInOnePagePerSheet, setCheckFontCompatibility, setCheckWorkbookDefaultFont, setCustomRenderSettings, setDefaultEditLanguage, setDefaultFont, setDrawObjectEventHandler, setEmfRenderSetting, setFontSubstitutionCharGranularity, setGridlineColor, setGridlineType, setIgnoreError, setOnePagePerSheet, setOutputBlankPageWhenNothingToPrint, setPageCount, setPageIndex, setPageSavingCallback, setPrintingPageType, setSheetSet, setTextCrossTypegetCachedFileFolder, getCheckExcelRestriction, getClearData, getCreateDirectory, getEncryptDocumentProperties, getMergeAreas, getRefreshChartCache, getSaveFormat, getSortExternalNames, getSortNames, getUpdateSmartArt, getValidateMergedAreas, getWarningCallback, setCachedFileFolder, setCheckExcelRestriction, setClearData, setCreateDirectory, setEncryptDocumentProperties, setMergeAreas, setRefreshChartCache, setSortExternalNames, setSortNames, setUpdateSmartArt, setValidateMergedAreas, setWarningCallbackpublic boolean getEmbedStandardWindowsFonts()
public void setEmbedStandardWindowsFonts(boolean value)
public PdfBookmarkEntry getBookmark()
PdfBookmarkEntry object.public void setBookmark(PdfBookmarkEntry value)
PdfBookmarkEntry object.public int getCompliance()
See PdfCompliance.
Remarks
Default is Pdf17.public void setCompliance(int value)
See PdfCompliance.
Remarks
Default is Pdf17.public PdfSecurityOptions getSecurityOptions()
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);
public void setSecurityOptions(PdfSecurityOptions value)
public ImageFormat getImageType()
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.public void setImageType(ImageFormat value)
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.public boolean getCalculateFormula()
Remarks
The default value is false.public void setCalculateFormula(boolean value)
Remarks
The default value is false.public int getPdfCompression()
See PdfCompressionCore.
public void setPdfCompression(int value)
See PdfCompressionCore.
public void setImageResample(int desiredPPI,
int jpegQuality)
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);
desiredPPI - Desired pixels per inch. 220 high quality. 150 screen quality. 96 email quality.jpegQuality - 0 - 100% JPEG quality.public DateTime getCreatedTime()
Remarks
if it is not be set, it will be the time of generating the pdf.public void setCreatedTime(DateTime value)
Remarks
if it is not be set, it will be the time of generating the pdf.public java.lang.String getProducer()
Remarks
If the value is null, or a valid LICENSE is not set, string Aspose.Cells vVERSION will be used.public void setProducer(java.lang.String value)
Remarks
If the value is null, or a valid LICENSE is not set, string Aspose.Cells vVERSION will be used.public int getOptimizationType()
See PdfOptimizationType.
Remarks
Default value isPdfOptimizationType.STANDARDpublic void setOptimizationType(int value)
See PdfOptimizationType.
Remarks
Default value isPdfOptimizationType.STANDARDpublic int getCustomPropertiesExport()
CustomDocumentPropertyCollection are exported to PDF file. Default value is None.
public void setCustomPropertiesExport(int value)
CustomDocumentPropertyCollection are exported to PDF file. Default value is None.
public boolean getExportDocumentStructure()
public void setExportDocumentStructure(boolean value)
public boolean getDisplayDocTitle()
Remarks
If false, the title bar should instead display the name of the PDF file. Default value is false.public void setDisplayDocTitle(boolean value)
Remarks
If false, the title bar should instead display the name of the PDF file. Default value is false.public int getFontEncoding()
See PdfFontEncoding.
Remarks
Default value isPdfFontEncoding.IDENTITYpublic void setFontEncoding(int value)
See PdfFontEncoding.
Remarks
Default value isPdfFontEncoding.IDENTITYpublic RenderingWatermark getWatermark()
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);
public void setWatermark(RenderingWatermark value)
public boolean getEmbedAttachments()
Remarks
Default value is false. The value must be false when PDF/A compliance is set or pdf encryption is enabled.public void setEmbedAttachments(boolean value)
Remarks
Default value is false. The value must be false when PDF/A compliance is set or pdf encryption is enabled.See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.