PDFsharp specifications
.NET Framework
PDFsharp 6.0 compiles against .NET 6 and should also work with higher .NET versions.
Supported image formats
Note for users of PDFsharp & MigraDoc Foundation version 1.5: With version 1.5 the packages PDFsharp and PDFsharp-MigraDoc still depended on GDI+ to import images. To get the same functionality with version 6.0, use either one of the -GDI oder one of the -WPF packages.
PDFsharp Core build
As of version 6.0.0, PDFsharp Core build supports the following image formats:
Windows Bitmap (BMP)
- True Color with or without transparency
- Palette images with 16 or 256 colors
- Images with 256 gray scales
- Monochrome images
Portable Network Graphics (PNG)
- True Color with or without transparency
- Palette images with 256 colors
- Images with 256 gray scales
JPEG images
- RGB
- Gray scales
- RGBW (inverted CMYK with four components per pixel)
Other images should be converted to Windows BMP or PNG for use with the Core build.
Please note that images in the PDF file will always be compressed, so converting to BMP instead of PNG will not generally lead to larger PDF files. So if, for example, your image is a 16 color raster image, then converting to BMP with 16 color may lead to a smaller PDF file than converting to a PNG file with 256 colors.
Support for other image formats may be added over time.
PDFsharp GDI build & PDFsharp WPF build
These builds continue to rely on Windows components, either GDI or WPF, to import images.
So all images that can be opened with the MS Paint application that comes with Windows should also work with PDFsharp.
File types that should work include
- Windows BMP
- PNG
- GIF
- TIFF
- OS/2 BMP
- JPEG
Some image types support many variations and some may not work with PDFsharp at all. Image conversion tools can come to the rescue.