Bsa.Pdf.Convert
1.0.42
dotnet add package Bsa.Pdf.Convert --version 1.0.42
NuGet\Install-Package Bsa.Pdf.Convert -Version 1.0.42
<PackageReference Include="Bsa.Pdf.Convert" Version="1.0.42" />
<PackageVersion Include="Bsa.Pdf.Convert" Version="1.0.42" />
<PackageReference Include="Bsa.Pdf.Convert" />
paket add Bsa.Pdf.Convert --version 1.0.42
#r "nuget: Bsa.Pdf.Convert, 1.0.42"
#:package Bsa.Pdf.Convert@1.0.42
#addin nuget:?package=Bsa.Pdf.Convert&version=1.0.42
#tool nuget:?package=Bsa.Pdf.Convert&version=1.0.42
Bsa.Pdf.Convert
Convert Word (.docx), Excel (.xlsx) and PDF documents to page images (PNG, JPEG, multi-page TIFF), and Word and Excel to PDF, in C#. No Microsoft Office, LibreOffice, Open XML SDK or headless browser: the package has its own layout engine (paragraphs, tables, headers and footers, footnotes, sections, text boxes, EMF/WMF pictures, Excel charts and print settings). Pages are rendered with PDFium. .NET 6, .NET 8, .NET 10 — Windows, Linux, macOS.
Documentation in Russian: README.ru.md in the package.
Installation
dotnet add package Bsa.Pdf.Convert
Usage
using System.IO;
using Bsa.Pdf.Convert;
var converter = new DocumentConverter(new ConvertOptions { Dpi = 150 });
var data = File.ReadAllBytes("report.docx");
// Word or Excel → PDF (a PDF input is returned as is)
File.WriteAllBytes("report.pdf", converter.ToPdf(data));
// Pages → PNG (or ImageFileFormat.Jpeg)
foreach (var page in converter.EnumerateImages(data))
{
File.WriteAllBytes($"page-{page.Index + 1}.png", page.Data);
}
// First and third pages only, JPEG
var pages = converter.ToImages(data, ImageFileFormat.Jpeg, new[] { 0, 2 });
// All pages → one multi-page TIFF
File.WriteAllBytes("report.tiff", converter.ToTiff(data));
The input format is detected by content, not by file name. EnumerateImages keeps only the current page in memory;
ToImages returns all pages at once. A DocumentConverter instance can be shared between threads.
Options
| Option | Default | Meaning |
|---|---|---|
Dpi |
150 | Image resolution, 36–600 |
JpegQuality |
85 | JPEG quality, 1–100 |
Password |
null | Password of a protected PDF |
FontFolders |
null | Extra font folders searched before the system fonts |
Culture |
current culture | Excel number and date formats that follow the regional settings |
DocumentName |
document |
File name for Excel header and footer fields (&F) |
Fonts
Text is laid out with the fonts installed in the system (Windows Fonts, Linux /usr/share/fonts, ~/.fonts,
macOS /Library/Fonts). Missing Microsoft fonts are replaced with metric-compatible ones: Arial → Liberation Sans,
Times New Roman → Liberation Serif, Courier New → Liberation Mono, Calibri → Carlito, Cambria → Caladea. On a Linux
server install them, for example fonts-liberation fonts-crosextra-carlito fonts-crosextra-caladea (Debian, Ubuntu,
Astra Linux) — or put the document fonts into a folder and pass it in FontFolders.
Errors
| Exception | When |
|---|---|
NotSupportedException |
The file is not PDF, .docx or .xlsx (legacy .doc and .xls are not supported) |
Bsa.Pdf.Core.Rendering.PdfRenderException |
The PDF is damaged, or protected and Password is missing or wrong (IsPasswordRequired is true) |
ArgumentOutOfRangeException |
A page index outside the document |
License
BSD-2-Clause. PDFium (bblanchon.PDFium.*) — BSD-3-Clause and Apache-2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- bblanchon.PDFium.Linux (>= 160.0.8165)
- bblanchon.PDFium.macOS (>= 160.0.8165)
- bblanchon.PDFium.Win32 (>= 160.0.8165)
- Bsa.Pdf.Jpeg (>= 1.0.42)
- Bsa.Pdf.Office (>= 1.0.42)
-
net6.0
- bblanchon.PDFium.Linux (>= 160.0.8165)
- bblanchon.PDFium.macOS (>= 160.0.8165)
- bblanchon.PDFium.Win32 (>= 160.0.8165)
- Bsa.Pdf.Jpeg (>= 1.0.42)
- Bsa.Pdf.Office (>= 1.0.42)
-
net8.0
- bblanchon.PDFium.Linux (>= 160.0.8165)
- bblanchon.PDFium.macOS (>= 160.0.8165)
- bblanchon.PDFium.Win32 (>= 160.0.8165)
- Bsa.Pdf.Jpeg (>= 1.0.42)
- Bsa.Pdf.Office (>= 1.0.42)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.42 | 46 | 11/20/2026 |