This class offers the necessary API to create a PDF document from an Excel workbook: xlsx, xlsm, xltx, xltm, xls,
xlt, csv, tsv, SpreadsheetML and markdown, read from a file, a stream or an array of bytes.
Inheritance HierarchySystemObject
ExpertPdf.Anywhere.ExcelToPdfPdfConverter
Namespace: ExpertPdf.Anywhere.ExcelToPdfAssembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntaxpublic class PdfConverter
Public Class PdfConverter
The PdfConverter type exposes the following members.
Constructors
Properties| | Name | Description |
|---|
 | AccessibilityStandard |
Gets or sets the accessibility standard the generated document declares. The default value is
None.
|
 | AutoDetectComplexScript |
Gets or sets whether right-to-left and complex scripts are detected in text that does not say so. The default
value is false.
|
 | ConvertBlankPages |
Gets or sets whether a page with no content in a sheet's printed range is kept. The default value is false.
|
 | ConvertBlankSheets |
Gets or sets whether a sheet with no content still produces a page. The default value is false.
|
 | GridLines |
Gets or sets whether the cell gridlines are drawn. The default is Automatic.
|
 | Language |
Gets or sets the natural language of the document content (for example "en-US"). Required for accessible
(PDF/UA) output.
|
 | Layout |
Gets or sets how the content of a sheet is scaled onto its pages. The default is
Automatic: the sheet's own print scaling.
|
 | LicenseKey |
Gets or sets the license key
|
 | PageRanges |
Gets or sets the pages of the converted workbook to keep, for example "1,3-5" or "2-" (1-based). The default
is every page.
|
 | PageSetup |
Gets or sets the page size and margins the sheets are laid out on. The default is
Document: each sheet's own page setup.
|
 | Password |
Gets or sets the password that opens an encrypted workbook.
|
 | PdfDocumentInfo |
Gets a reference to an object to set the document information of the generated PDF document: title, author,
subject, keywords and creation date.
|
 | PdfDocumentOptions |
Gets a reference to an object to control the generated PDF document options. The page size, orientation and
margins are used when PageSetup is Options; the margins also make
room for the header and footer.
|
 | PdfFooterOptions |
Gets a reference to an object to control the generated PDF document footer options
|
 | PdfHeaderOptions |
Gets a reference to an object to control the generated PDF document header options
|
 | PdfSecurityOptions |
Gets a reference to an object to set the security of the generated PDF document: a password to open it, an
owner password, the permissions and the encryption. The document is encrypted only when one of these options
is changed from its default.
|
 | PdfStandardSubset |
Gets or sets the PDF standard of the generated document. The default is
Full.
|
 | PreserveFormFields |
Gets or sets whether the sheets' form controls become PDF form fields. The default value is false: they are
drawn as they look.
|
 | SheetBookmarks |
Gets or sets whether the PDF outline gets an entry per sheet. The default value is true.
|
 | SheetHeadersAndFooters |
Gets or sets whether the sheets' own printed headers and footers are drawn. The default value is true.
|
 | Worksheets |
Gets or sets the sheets to convert, by name, comma separated. The default is every visible sheet; a name the
workbook does not have is an error.
|
Top
Methods| | Name | Description |
|---|
 | GetPdfBytesFromExcelBytes(Byte) |
Gets the PDF document converted from an Excel workbook given as an array of bytes, its format detected from the content
(xlsx, xls, SpreadsheetML or csv).
|
 | GetPdfBytesFromExcelBytes(Byte, ExcelFormat) |
Gets the PDF document converted from an Excel workbook of the given format given as an array of bytes.
|
 | GetPdfBytesFromExcelFile(String) |
Gets the PDF document converted from an Excel workbook file, its format taken from the file extension.
|
 | GetPdfBytesFromExcelFile(String, ExcelFormat) |
Gets the PDF document converted from an Excel workbook file of the given format.
|
 | GetPdfBytesFromExcelStream(Stream) |
Gets the PDF document converted from an Excel workbook in a stream, its format detected from the content (xlsx, xls, SpreadsheetML or csv).
|
 | GetPdfBytesFromExcelStream(Stream, ExcelFormat) |
Gets the PDF document converted from an Excel workbook of the given format in a stream.
|
 | SavePdfFromExcelFileToFile |
Saves the PDF document converted from an Excel workbook file to a file.
|
 | SavePdfFromExcelFileToStream(String, Stream) |
Saves the PDF document converted from an Excel workbook file to a stream.
|
 | SavePdfFromExcelFileToStream(String, ExcelFormat, Stream) |
Saves the PDF document converted from an Excel workbook file of the given format to a stream.
|
 | SavePdfFromExcelStreamToFile |
Saves the PDF document converted from an Excel workbook in a stream to a file.
|
 | SavePdfFromExcelStreamToStream(Stream, Stream) |
Saves the PDF document converted from an Excel workbook in a stream to another stream.
|
 | SavePdfFromExcelStreamToStream(Stream, ExcelFormat, Stream) |
Saves the PDF document converted from an Excel workbook of the given format in a stream to another stream.
|
Top
RemarksThe workbook is printed by the Excel engine, sheet by sheet, as Excel prints it: by default
(PageSetup = Document) each sheet keeps its own paper, orientation,
margins, scaling, print area and page breaks; with Options every sheet is laid out
on the page size, orientation and margins of PdfDocumentOptions. Formulas are calculated, charts,
pictures and conditional formats are drawn, and hidden sheets are left out.
Each sheet becomes an entry of the PDF outline (SheetBookmarks), links stay live, and the
PDF/A, PDF/X and PDF/UA levels, the security options and the document information apply as they do for the other
converters.
ExamplePdfConverter pdfConverter = new PdfConverter();
pdfConverter.PdfDocumentOptions.ShowFooter = true;
pdfConverter.PdfFooterOptions.ShowPageNumber = true;
pdfConverter.SavePdfFromExcelFileToFile("report.xlsx", "report.pdf");Dim pdfConverter As New PdfConverter()
pdfConverter.PdfDocumentOptions.ShowFooter = True
pdfConverter.PdfFooterOptions.ShowPageNumber = True
pdfConverter.SavePdfFromExcelFileToFile("report.xlsx", "report.pdf")
See Also