Click or drag to resize
Pdf Library for .NET

Excel To Pdf Converter Options Review

ExcelToPdfOptions, reached through Options, controls the conversion and the generated document. Most of it is the same surface as HtmlToPdfOptions, with the same defaults, so it is only listed here; the properties that belong to the Excel engine are described.

The options shared with the html converter

Property

What it does

PdfPageSize, PdfPageCustomSize, PdfPageOrientation

The page of the generated document. Applied only under the Options page setup; under Document each sheet keeps the paper of its own page setup.

MarginLeft, MarginRight, MarginTop, MarginBottom

Margins in points, zero by default. Applied under both page setups: they surround the printed page (Document) or replace the sheets' margins (Options).

DisplayHeader, DisplayFooter

Show the bands built through Header and Footer. Text, image, html, Word, Excel and PowerPoint sections all work; see Headers and Footers.

ExternalLinksEnabled, InternalLinksEnabled

Carry the workbook's web links and its links to other cells and sheets as clickable pdf links. Both on by default.

PageRanges

Keep only the named rendered pages, e.g. "1,3-5". A range that selects none of the rendered pages is refused.

GenerateSinglePagePdf

Stack every rendered page onto one tall pdf page.

PdfStandard, ColorSpace

PDF/A-1b to PDF/A-4 and PDF/X-1a, and the color space, produced as the html converter produces them.

Tagged, AccessibilityStandard, Title, Language

Tagged (accessible) output: the sheets' tables, charts, pictures and links become the logical structure of the pdf, declared as PDF/UA-1 or PDF/UA-2 with the title and the language a declared document must carry. See the Standards section of the converter topic.

SecurityOptions, ViewerPreferences, PdfDocumentInformation

Passwords and permissions, how a viewer opens the document, and its title, author, subject and keywords.

JpegCompressionEnabled, JpegCompressionLevel, PdfCompressionLevel

Image and stream compression, with the html converter's defaults.

ImagesMaxResolution

The highest resolution, in pixels per inch, an image is kept at; images drawn at a higher resolution are resampled down to it. 0 (the default) keeps every image as it is.

LFN

A diagnostic log file written during the conversion.

The Excel engine's own options

Property

Default

What it does

PageSetup

Document

Whether every sheet is printed on the paper and margins of its own page setup (Document) or laid out on the page size, orientation and margins of the options (Options). See Getting Started.

Password

none

The password of an encrypted workbook.

Worksheets

empty

The sheets converted, by name, comma separated, e.g. "Summary, Q1". Empty converts every visible sheet in workbook order; naming a sheet the workbook does not have fails the conversion.

Layout

Automatic

How the content of each sheet is scaled onto its pages: the sheet's own print scaling, its actual size, the whole sheet on one page, all its columns on one page or all its rows on one page (ExcelLayout).

GridLines

Automatic

Whether the cell gridlines are drawn: as each sheet's print setting says, always, or never (ExcelGridLines).

SheetBookmarks

true

One entry in the pdf outline per sheet, named after it.

SheetHeadersAndFooters

true

Draw the headers and footers set in the sheets' own page setup. They are independent of the converter's header and footer bands.

ConvertBlankSheets, ConvertBlankPages

false

Keep a page for a sheet with no content, and keep the empty pages inside a sheet's printed range.

PreserveFormFields

false

Turn the sheets' form controls (check boxes, option buttons, combo boxes) into fillable pdf form fields instead of drawings.

AutoDetectComplexScript

false

Detect and shape complex scripts (Arabic, Hebrew, Thai and the like) even where the workbook does not mark them.

The conversion result

After a conversion, ConversionResult describes the document produced: PdfPageCount, PdfPageSize, PdfPageLastIndex, PdfPageLastRectangle and PdfPagesRectangles, one rectangle per rendered page in the coordinates of the pdf page it landed on. A workbook that cannot be read or rendered fails the conversion with ExcelToPdfException.

See Also