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.Createhas a number of static methods that can be used to create specific document formats, providing format-specific options.MuPDFDocument.Create.Documentoverloads are mostly equivalent to theMuPDFDocument.CreateDocument; here, thefileTypeparameter 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.PDFDocumentto create PDF documents.MuPDFDocument.Create.SVGDocumentto create SVG files (single-page).MuPDFDocument.Create.CBZDocumentto create CBZ documents.MuPDFDocument.Create.TextDocumentto create a text document.MuPDFDocument.Create.StructuredTextDocumentto create a structured text XML document.MuPDFDocument.Create.HTMLDocumentto create an HTML document.MuPDFDocument.Create.XHTMLDocumentto create an XHTML document.
- As a result,
MuPDFDocument.CreateDocumentis 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
MuPDFDocumentclass now has anOptionalContentGroupDataproperty, 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
MuPDFOptionalContentGroupcan be enabled or disabled programmatically, while theUIproperty of theMuPDFOptionalContentGroupConfigurationclass 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
Linksproperty of theMuPDFPageclass provides a list of all the links contained on the page; eachMuPDFLinkhas anActiveAreaand aDestination(which can be internal or external). TheIsVisibleproperty can be used to determine whether the link is visible (based on the current OCG/layer configuration).
- The
-
New
GetBoundingBoxmethod 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 flagsparameter of theGetStructuredTextPagemethod, which replaces the previousbool preserveImages(this is also a breaking change). Multiple flags can be combined with the|operator (e.g.,StructuredTextFlags.PreserveImages | StructuredTextFlags.Dehyphenatewill both preserve images and dehyphenate the document).