PDFsharp Documentation

repository·master·Indexed 19 days ago

https://github.com/empira/pdfsharp

PDFsharp is a high-performance .NET library for creating and manipulating PDF documents, complemented by MigraDoc, which provides a high-level object model for document creation. Version 7.0.0 Preview 1 supports C# 12 and .NET 8, 9, and 10. The library offers cross-platform Core packages for Linux and macOS, as well as Windows-only GDI and WPF packages for extended image format support. Additional assemblies include PDFsharp.BarCode for barcode drawing and PDFsharp.Cryptography for digital signatures.

Tokens
11.1K
Snippets
23
Records
107
Agent score
76%

What's inside PDFsharp

  1. What is PdfSharp.Quality.Ghostscript?

    master

    The PdfSharp.Quality.Ghostscript project provides functionality that leverages Ghostscript (from Artifex Software Inc.) to perform specific tasks, primarily converting PDF files into PNG images.

    Important Note: This project is used exclusively for testing and quality control of PDFsharp during development. PDFsharp itself does not use or depend on Ghostscript for its core operations.

  2. Overview of PDFsharp

    master

    PDFsharp is an open-source .NET library designed for creating and modifying PDF documents. It provides a programmatic API for generating or editing PDF files, making it suitable for tasks such as creating reports, invoices, and other document types.

    Key characteristics:

    • Cross-platform: The library does not depend on Windows and is compatible with any .NET platform, including Linux and macOS.
    • API-driven: Allows for programmatic manipulation of PDF structures.
  3. What is MigraDoc?

    master

    MigraDoc is a .NET library designed for creating documents like PDF and RTF using a high-level object model. It provides an intuitive API for managing document elements such as text formatting, tables, and images. It is commonly used for generating reports, invoices, and other structured documents.

    Platform Requirement: This specific package relies on Windows Presentation Foundation (WPF) and is restricted to Windows only environments.

  4. Overview of PDFsharp GDI build

    master

    PDFsharp is an open-source .NET library designed for creating and modifying PDF documents programmatically. It provides an API for generating or editing PDF files, which is useful for applications such as creating reports, invoices, and other document types.

    Important Platform Restriction: The GDI build of PDFsharp relies on Windows Forms (GDI+) and is restricted to Windows-only environments.

  5. New Features in PDFsharp 6.2.0 Preview 1

    master

    The 6.2.0 Preview 1 release introduced several major capabilities:

    • Digital Signatures: Ability to sign PDF documents.
    • Multi-colored glyphs: Support for emojis and other multi-colored glyphs.
    • PDF/A Support: Ability to create PDF/A conforming documents (currently with some limitations).
    • Expanded Target Frameworks: Support for .NET 8 (net8.0) and a downgrade of .NET Framework references to 4.6.2 (net462).
    • PDFsharp.Shared: A new assembly providing friendly access to all PDFsharp project assemblies.
  6. Use PDFsharp.Cryptography for digital signatures

    master

    The PDFsharp.Cryptography assembly provides classes for signing PDF documents with digital signatures using the PDFsharp default signer.

    This is a separate assembly designed to decouple digital signature functionality from the core PDFsharp.dll. By using this package, you can include signature capabilities in your project without forcing a dependency on System.Security.Cryptography.Pkcs in the main PDFsharp.dll for projects that do not require digital signatures.

  7. New features in PDFsharp 6.3

    master

    Version 6.3 introduces several core improvements and new components:

    • PDF Object Model: The object model has been revised.
    • PDF/A Support: Added PdfAManager for enhanced PDF/A capabilities.
    • File Embedding: Introduced FileManager for managing embedded files.
    • XMP Metadata: Support for XMP metadata.
    • PdfDate: Now uses DateTimeOffset internally to resolve discrepancies between .NET and .NET Framework.
    • PdfName: Now based on a new Name class with improved UTF-8 encoding, delimiter escaping, and empty name handling.
  8. What's new in PDFsharp 6.2.4

    master

    PDFsharp version 6.2.4 introduces several fixes and improvements:

    • Encryption Compatibility: The /Length entry is now always added to encrypted PDF files, even when optional according to PDF specifications. This ensures compatibility with PDF viewers like Microsoft Edge that may fail to open encrypted files without this entry.
    • JPEG Handling: Improved handling of JPEG JFIF files that use 'byte stuffing' (specifically the 0xff 0x00 combination) to prevent exceptions.
    • Array Formatting: Content streams containing arrays (CArray) are now saved with spaces for better formatting.
    • Indirect DecodeParms: Fixed an issue where an exception was thrown if DecodeParms were specified as an indirect object.