Releases: arklumpus/MuPDFCore
Version 2.0.1
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).
Version 1.10.2
- In cases where things are disposed out of order, a new kind of exception is now thrown (
LifetimeManagementException
), in order to prevent nastierAccessViolationException
s down the line (#35).
Version 1.10.1
New features
- Updated to MuPDF 1.24.3.
- Added support for retrieving images and font information from structured text pages (#31).
- It is now possible to save individual images or to get access to their pixel values.
- For fonts, the font name and style are reported. Two methods provide access to the native font handles (but these won't be particularly useful without bindings for the FreeType library or the internal Type3 font renderer).
Bugfixes
- MuPDFCore.MuPDFRenderer: fixed issue with selection not clearing after the page is updated (#32).
Version 1.9.0
New features
- Updated MuPDF to 1.24.0
- Support for new input formats: TXT (text files), DOCX (Microsoft Word), PPTX (Microsoft Powerpoint), XLSX (Microsoft Excel). Note that only plain text is extracted from Office documents and the layout is not fully respected.
- The
MuPDFDocument
class now has anOutline
property, which makes it possible to access the document's outline (table of contents), if one is defined (#29). The PDF viewer demo shows document outlines.
Bugfixes
- The background of the
MuPDFRenderer
control now works correctly when the control has a non-zero offset.
Version 1.8.0
New features
- Updated MuPDF to 1.23.6.
- Added API to get/set the anti-aliasing level (#27).
- The
MuPDFContext.GraphicsAntiAliasing
property can be used to get and set the graphics anti-aliasing. - The
MuPDFContext.TextAntiAliasing
property can be used to get and set the text anti-aliasing. - The
MuPDFContext.AntiAliasing
property (write-only) can be used to set both the graphics and text anti-aliasing to the same level.
- The
- Added support for JPEG output format.
- Added support for MOBI and HTML input format. This is both integrated within the general
MuPDFDocument.SaveImage
andMuPDFDocument.WriteImage
methods, as well as in two dedicated methods (MuPDFDocument.SaveImageAsJPEG
andMuPDFDocument.WriteImageAsJPEG
) that allow specifying the JPEG quality level. - Added API to layout reflowable document types (e.g., MOBI and HTML):
MuPDFDocument.Layout(float width, float height, float em)
can be used to layout the document using a fixed page size.MuPDFDocument.LayoutSinglePage(float width, float em)
can be used to layout the document to a single page of the specified width.
After these methods have been called, thePages
of the MuPDFDocument will be recreated with the specified layout.
- Enabled strong name signing (#23).
- Native assets are now in separate NuGet packages (the right packages should be picked automatically).
linux-musl-x64
andlinux-musl-arm64
no longer require manually copying the native asset (but see the note forlinux-musl-arm64
).- MuPDFCore.MuPDFRenderer now targets Avalonia 11 (#26).
Version 1.7.0
New features
- Updated MuPDF to 1.21.1.
- Added support form
linux-musl-x64
andlinux-musl-arm64
platforms.- To get this to work, download the asset you need from this page, and use it to replace the default glibc-based
libMuPDFWrapper.so
file that gets created when you build your app.
- To get this to work, download the asset you need from this page, and use it to replace the default glibc-based
Version 1.6.0
New features
- Updated MuPDF to version 1.20.0.
- Added a wiki with some information and examples (that used to be in the homepage of the repository).
- Added methods to support encrypted and restricted (password-protected) documents (#17), see the page in the wiki.
Notable changes
- Attempting to render an encrypted document without first unlocking it with the user password now results in an exception, rather than producing blank pages as in previous versions.
Version 1.5.0
New features
- Updated MuPDF to version 1.19.1.
- Added methods to suppress and redirect the standard output and standard error from the native MuPDF library to managed events.
- Added parameters to report OCR progress and to allow cancellation (not supported on Windows x86).
- Added overloads that return
Span<byte>
(#16). - New constructor for
DisposableIntPtr
, which adds and removes GC memory pressure when it is created/disposed. - Added support for Tesseract OCR on Mac-arm64.
Bugfixes
- Fixed platform target for Linux-arm64 and Mac-arm64 tests.
- Added missing build options for Linux-arm64.
Version 1.4.1
Bugfixes
- Fixed a bug occurring when input or output file names contain characters outside the ASCII range (#14).