Version 2.0.0
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 classMuPDFDocument.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 theMuPDFDocument.CreateDocument
; here, thefileType
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.
- Instead of invoking
-
New methods and properties to work with optional content groups (OCGs, also known as layers) in PDF documents.
- The
MuPDFDocument
class now has anOptionalContentGroupData
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 theUI
property of theMuPDFOptionalContentGroupConfiguration
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.
- The
-
New methods and properties to access links in documents.
- The
Links
property of theMuPDFPage
class provides a list of all the links contained on the page; eachMuPDFLink
has anActiveArea
and aDestination
(which can be internal or external). TheIsVisible
property can be used to determine whether the link is visible (based on the current OCG/layer configuration).
- The
-
New
GetBoundingBox
method to get the various kinds of bounding boxes from aMuPDFPage
(#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 theGetStructuredTextPage
method, which replaces the previousbool 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).