Excel |
The ExcelToPdfArea type exposes the following members.
| Name | Description | |
|---|---|---|
| ExcelToPdfArea(Stream) | Creates an area that shows a workbook read from a stream, filling the band from its top left corner. | |
| ExcelToPdfArea(String) | Creates an area that shows a Excel file, filling the band from its top left corner. | |
| ExcelToPdfArea(Single, Single, Stream) | Creates an area that shows a workbook read from a stream, at a position in the band, to its right edge and bottom. | |
| ExcelToPdfArea(Single, Single, String) | Creates an area that shows a Excel file, at a position in the band, to its right edge and bottom. | |
| ExcelToPdfArea(Single, Single, Single, Single, Stream) | Creates an area that shows a workbook read from a stream in a rectangle of the band. | |
| ExcelToPdfArea(Single, Single, Single, Single, String) | Creates an area that shows a Excel file in a rectangle of the band. |
| Name | Description | |
|---|---|---|
| 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 nothing on it is drawn. The default value is false. | |
| ConvertBlankSheets | Gets or sets whether a sheet with nothing on it is drawn. The default value is false. | |
| Format | Gets or sets the format of the workbook. The default, Automatic, takes it from the file extension, or detects it from the content of a stream. | |
| GridLines | Gets or sets whether the gridlines are drawn. The default follows each sheet's own print setting. | |
| Height | Gets or sets the height of the area, in points; 0 or less reaches the bottom of the band. | |
| InternalLinksEnabled | Gets or sets whether the workbook's links to places in itself are live. The default value is true. | |
| Layout | Gets or sets how each sheet is scaled onto the pages. The default is fitting each sheet on one page, since an area shows one page. | |
| LiveUrlsEnabled | Gets or sets whether the workbook's web links are live in the area. The default value is true. | |
| PageRanges | Gets or sets the page of the rendered workbook the area shows, for example "2". The default is the first page. | |
| Password | Gets or sets the password that opens an encrypted workbook. | |
| SheetHeadersAndFooters | Gets or sets whether the sheets' own printed headers and footers are drawn. The default value is true. | |
| Width | Gets or sets the width of the area, in points; 0 or less reaches the right edge of the band. | |
| Worksheets | Gets or sets the sheets drawn, by name, separated by commas. The default is every visible sheet. | |
| X | Gets or sets the X position of the area in the band, in points. | |
| Y | Gets or sets the Y position of the area in the band, in points. |
Add it to the header or footer of the HTML to PDF converter with AddExcelToPdfArea(ExcelToPdfArea) / AddExcelToPdfArea(ExcelToPdfArea).
Every format the Excel to PDF converter reads is accepted: xlsx, xlsm, xltx, xltm, xls, xlt, csv, tsv, SpreadsheetML and markdown. The sheet is laid out on a page the size of the area, fitted onto it by default (Layout).
PdfConverter pdfConverter = new PdfConverter(); pdfConverter.PdfDocumentOptions.ShowHeader = true; pdfConverter.PdfHeaderOptions.HeaderHeight = 60; pdfConverter.PdfHeaderOptions.AddExcelToPdfArea(new ExcelToPdfArea(0, 0, "sales.xlsx")); byte[] pdf = pdfConverter.GetPdfBytesFromUrl("https://www.html-to-pdf.info");