Click or drag to resize

ExcelToPdfElement Class

An Excel workbook drawn into a page region, the Excel counterpart of WordToPdfElement.
Inheritance Hierarchy
SystemObject
  ExpertPdf.Anywhere.PdfDocumentPageElement
    ExpertPdf.Anywhere.PdfDocumentPageGraphicElement
      ExpertPdf.Anywhere.PdfDocumentExcelToPdfElement

Namespace: ExpertPdf.Anywhere.PdfDocument
Assembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntax
public sealed class ExcelToPdfElement : PageGraphicElement

The ExcelToPdfElement type exposes the following members.

Constructors
 NameDescription
Public methodExcelToPdfElement(Stream)Creates an element that draws a workbook read from a stream from the top left corner of the page.
Public methodExcelToPdfElement(String)Creates an element that draws a Excel file from the top left corner of the page.
Public methodExcelToPdfElement(Single, Single, Stream)Creates an element that draws a workbook read from a stream at a position on the page.
Public methodExcelToPdfElement(Single, Single, String)Creates an element that draws a Excel file at a position on the page.
Public methodExcelToPdfElement(Single, Single, Single, Stream)Creates an element that draws a workbook read from a stream at a position with a width.
Public methodExcelToPdfElement(Single, Single, Single, String)Creates an element that draws a Excel file at a position with a width.
Public methodExcelToPdfElement(Single, Single, Single, Single, Stream)Creates an element that draws a workbook read from a stream in a rectangle.
Public methodExcelToPdfElement(Single, Single, Single, Single, String)Creates an element that draws a Excel file in a rectangle.
Top
Properties
 NameDescription
Public propertyActualText Gets or sets the exact text this element stands for in a tagged document, when its content does not spell it (text drawn as an image or with an unusual font, for example). The default value is null.
(Inherited from PageElement)
Public propertyAlternateText Gets or sets the alternate description of this element in a tagged document, read by assistive technology instead of the content - the description of a figure, for example. PDF/UA requires it for figures. The default value is null.
(Inherited from PageElement)
Public propertyArtifact Gets or sets whether this element is decorative in a tagged document: it is marked as an artifact (a background, a rule, a running header) and left out of the logical structure. The default value is false.
(Inherited from PageElement)
Public propertyAutoDetectComplexScriptGets or sets whether right-to-left and complex scripts are detected in text that does not say so. The default value is false.
Public propertyBackColor Gets or sets the element background color.
(Inherited from PageGraphicElement)
Public propertyBlending Gets or sets the blending mode for the transparent rendering of the element.
(Inherited from PageGraphicElement)
Public propertyColorSpace Gets or sets the color space the element colors are written in: RGB (the default), CMYK or grayscale.
(Inherited from PageGraphicElement)
Public propertyConvertBlankPagesGets or sets whether a page with nothing on it is drawn. The default value is false.
Public propertyConvertBlankSheetsGets or sets whether a sheet with nothing on it is drawn. The default value is false.
Public propertyForeColor Gets or sets the element foreground color.
(Inherited from PageGraphicElement)
Public propertyFormat 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.
Public propertyGradient Gets or sets the gradient used to fill a shape.
(Inherited from PageGraphicElement)
Public propertyGridLinesGets or sets whether the gridlines are drawn. The default follows each sheet's own print setting.
Public propertyHeightGets or sets the height, in points; -1 to flow onto the pages that follow.
Public propertyInternalLinksEnabledGets or sets whether the workbook's links to places in itself are live. The default value is true.
Public propertyLayoutGets or sets how each sheet is scaled onto the pages. The default is the sheet's own print scaling.
Public propertyLineStyle Gets or sets the line style of the elements that render lines.
(Inherited from PageGraphicElement)
Public propertyLiveUrlsEnabledGets or sets whether the workbook's web links are live. The default value is true.
Public propertyPageRangesGets or sets the pages of the rendered workbook drawn, for example "1-3". The default is every page.
Public propertyPasswordGets or sets the password that opens an encrypted workbook.
Public propertyPdfPagesRectangles Gets where each slice of the workbook was drawn, after the element is added to a page: one rectangle per page it covers, in that page's coordinates.
Public propertyRotated Gets whether the element is rotated (Rotate was called with a non-zero angle).
(Inherited from PageGraphicElement)
Public propertyScaled Gets whether the element is scaled (Scale was called with a factor other than 1).
(Inherited from PageGraphicElement)
Public propertySheetBookmarksGets or sets whether each sheet becomes an entry of the document outline. The default value is true.
Public propertySheetHeadersAndFootersGets or sets whether the sheets' own printed headers and footers are drawn. The default value is true.
Public propertySkewed Gets whether the element is skewed (Skew was called with a non-zero angle).
(Inherited from PageGraphicElement)
Public propertyTagged Gets or sets whether the region carries the workbook's structure into a tagged document. The default value is false; in a tagged document the region is tagged even when it is false, unless it is an Artifact.
Public propertyTagType Gets or sets the structure type of this element in a tagged document (a heading, a paragraph, a figure and so on). Every element added to a tagged document must have a tag type or be an Artifact. Ignored in a document that is not tagged. The default value is null.
(Inherited from PageElement)
Public propertyTranslated Gets whether the element is translated (Translate was called with a non-zero offset).
(Inherited from PageGraphicElement)
Public propertyTransparency Gets or sets the element transparency, as a value between 0 and 100: 0 means completely transparent and 100 completely opaque. The default value is 100.
(Inherited from PageGraphicElement)
Public propertyWidthGets or sets the width, in points; -1 for the room left on the page.
Public propertyWorksheetsGets or sets the sheets drawn, by name, separated by commas. The default is every visible sheet.
Public propertyXGets or sets the X position, in points.
Public propertyYGets or sets the Y position, in points.
Top
Methods
 NameDescription
Public methodRotate Rotates the coordinate system axes clockwise by the specified angle before rendering the element. The coordinates of the element are relative to the rotated coordinates system.
(Inherited from PageGraphicElement)
Public methodScale Scales the coordinates so that 1 unit in the horizontal and vertical dimensions of the new coordinate system is the same size as sx and sy units, respectively, in the previous coordinate system.
(Inherited from PageGraphicElement)
Public methodSkew Skews the x axis by an skewXAngle and the y axis by an skewYAngle before rendering the element.
(Inherited from PageGraphicElement)
Public methodTranslate Translates the coordinate system before rendering the element. The coordinates of the element are relative to the translated coordinate system.
(Inherited from PageGraphicElement)
Top
Remarks

With an automatic height (-1, the default) the workbook flows from the element's position onto the pages that follow, adding pages when the document has none left; with a fixed height it is drawn in that box and continues on the next pages until that much height is drawn. The width defaults to the room left on the page. Every format the Excel to PDF converter reads is accepted: xlsx, xlsm, xltx, xltm, xls, xlt, csv, tsv, SpreadsheetML and markdown. Every sheet is laid out on pages the size of the region, with no margins of its own.

Its links stay live and each sheet becomes an entry of the document outline (SheetBookmarks). PdfPagesRectangles reports where each slice was drawn. In a tagged document the region carries the workbook's structure when Tagged is set; in a template it must be decorative (Artifact).

Example
Document document = new Document();
PdfPage page = document.AddPage();
page.AddElement(new ExcelToPdfElement(0, 0, "sales.xlsx"));
document.Save("result.pdf");
See Also