Skip to content

Version 2.0.0

Compare
Choose a tag to compare
@arklumpus arklumpus released this 25 Dec 17:32
· 6 commits to master since this release

New features

  • Updated to MuPDF 1.25.2.

    • I am now using a fork of MuPDF, in order to better maintain my changes to the upstream library.
  • New API for document creation/conversion.

    • Instead of invoking MuPDFDocument.CreateDocument, the static class MuPDFDocument.Create has a number of static methods that can be used to create specific document formats, providing format-specific options.
      • MuPDFDocument.Create.Document overloads are mostly equivalent to the MuPDFDocument.CreateDocument; here, the fileType parameter is used to specify the output format, and the default options for that format are used.
      • Each of the other methods can be used to create a specific kind of document, providing format-specific options:
        • MuPDFDocument.Create.PDFDocument to create PDF documents.
        • MuPDFDocument.Create.SVGDocument to create SVG files (single-page).
        • MuPDFDocument.Create.CBZDocument to create CBZ documents.
        • MuPDFDocument.Create.TextDocument to create a text document.
        • MuPDFDocument.Create.StructuredTextDocument to create a structured text XML document.
        • MuPDFDocument.Create.HTMLDocument to create an HTML document.
        • MuPDFDocument.Create.XHTMLDocument to create an XHTML document.
    • As a result, MuPDFDocument.CreateDocument is now deprecated, which is somewhat of a breaking change.
  • New methods and properties to work with optional content groups (OCGs, also known as layers) in PDF documents.

    • The MuPDFDocument class now has an OptionalContentGroupData property, which can be used to access the OCG information, if any. This provides access to the default and alternative configurations, as well as the individual OCGs (layers).
    • Individual MuPDFOptionalContentGroup can be enabled or disabled programmatically, while the UI property of the MuPDFOptionalContentGroupConfiguration class provides access to a tree-like structure of UI elements (labels, check boxes, radio buttons) that should be presented to the end-user for manual toggling.
  • New methods and properties to access links in documents.

    • The Links property of the MuPDFPage class provides a list of all the links contained on the page; each MuPDFLink has an ActiveArea and a Destination (which can be internal or external). The IsVisible property can be used to determine whether the link is visible (based on the current OCG/layer configuration).
  • New GetBoundingBox method to get the various kinds of bounding boxes from a MuPDFPage (#38).

  • Changes to how structured text representations are handled, to allow for new types of structured text blocks:

    • MuPDFGridStructuredTextBlock, representing "grid" lines.
    • MuPDFStructureStructuredTextBlock, representing structural elements.
    • MuPDFVectorStructuredTextBlock, representing blocks of vector art.

    The kind of structured text blocks produced is determined by the new optional StructuredTextFlags flags parameter of the GetStructuredTextPage method, which replaces the previous bool preserveImages (this is also a breaking change). Multiple flags can be combined with the | operator (e.g., StructuredTextFlags.PreserveImages | StructuredTextFlags.Dehyphenate will both preserve images and dehyphenate the document).