PDF export is handled by unvell.ReoGrid.IO.Pdf. It depends on no external packages,
and since it does not depend on System.Drawing either, it also runs on Linux / macOS servers.
V4 could only produce PDF through the print pipeline; V5 exports it directly.
Exporting
using unvell.ReoGrid.IO.Pdf;
PdfExporter.Export(wb, "book.pdf"); // 全シート
PdfExporter.Export(ws, "sheet.pdf"); // 1 シートだけ
byte[] bytes = PdfExporter.ExportToBytes(wb); // ストリームで受け取る
ExportToBytes is for cases such as returning the PDF as a Web API response.
Applying print settings
var settings = new PrintSettings
{
Paper = PaperKind.A4,
Orientation = PageOrientation.Landscape,
ShowGridLines = false,
FitToPagesWide = 1,
};
PdfExporter.Export(ws, "sheet.pdf", settings);
If you omit the settings, the sheet’s ws.PrintSettings is used.
The available options are shared with Printing and Page Setup.
Japanese font
IPAexGothic is embedded in the DLL (Type0 / CIDFontType2). Japanese text is rendered even when no fonts are installed on the server.
Latin text uses the four standard Helvetica faces (regular, bold, oblique, bold oblique).
Multiple pages
Page breaks are computed by the same engine used for printing (Paginator). Rows and columns
are never split — just like Excel — and are packed into the printable area.
Images
Images placed on the sheet are embedded as-is (Images). PNG and JPEG are supported.
Conditional formatting
Data bars, color scales, and icon sets are rendered as well. Icons are drawn with the
IGridGraphics ellipse and polygon primitives, so they look the same as on screen.
Licensing
Without a license key applied, the exported PDF carries a watermark. The export itself still runs, so you can continue evaluating (Applying a License Key).
Limitations
- Print titles (repeating rows/columns on every page) and headers/footers (page numbers) are not supported
- Font subsetting is not supported — PDFs containing Japanese text embed the whole IPAexGothic font, adding several MB to the file
- Bold and italic CJK faces are not supported — Japanese text set in bold renders with the regular face
Server-side use
Included in unvell.ReoGrid.One.Core (net10.0, zero dependencies).
For the flow of reading XLSX and turning it into PDF, see
Using ReoGrid Headless.