Breaking changes
PDF.js Express 8.0.0 drops support for IE11. Continuing to support IE11 is not sustainable, and dropping support for IE11 allows us to use more modern Javascript paradigms which in turn allows us to make a better product.
While technically not a breaking change, there are new namespaces on the
instance
object forCore
andUI
. You can find more details and examples inside the migration guide.
See v8 migration guide for information on the breaking changes.
PDF.js Express Core
New
- Added support for rotating freetext, stamp, rectangle and ellipse annotations
- Added a new
Core
namespace which replaces theCoreControls
namespace and now contains all the other namespaces (e.g. Annotations, Tools, etc). Note that the previous namespace structure is still usable but deprecated. See the migration guide for more details - Added support for passing initialization options into Annotation constructors (e.g. X, Y, Width, FillColor, etc)
- Updated a number of APIs to be of the form
enableXYZ
/disableXYZ
. The previous APIs are still available for backwards compatibility. - Renamed
CoreControls.js
towebviewer-core.min.js
- Updated annotation linking to use the normal grouping APIs instead of special link only APIs
- Added support for scrolling a document with two fingers on mobile devices
- Added the
fieldManager.areRequiredFieldsFilled
API that returns true if all required fields in the current document have a value - Added the
fieldManager.getFields
API which returns an array of all fields in the document, including nested fields - Added a tool for creating freehand highlight annotations, typically used for highlighting images or text on scanned documents
- For files with no extension specified or contained in the URL, WebViewer will attempt to read the Content-Type header to determine the type of file
- Removed the
WidgetEditingManager
as it has been replaced by theFormFieldCreationManager
- Updated the
annotationManager.jumpToAnnotation
API to take optional optionszoom
,horizontalOffset
,verticalOffset
andfitToView
- Improved the performance of automatic page linking so that it doesn't slow down the
annotationsLoaded
event - Updated the
annotationManager.getDisplayAuthor
API to take an author string instead of an annotation object - Added the
freetextAnnotation.setAutoSizeType
API which lets the type of autosizing being used be changed programmatically - Added the
useStamp
API on theRubberStampCreateTool
. When called on an instance of this tool it will immediately create a stamp with the provided properties that can be added to the page. - Updated the
setCustomData
function to only take in strings, and thegetCustomData
function to only return strings. TheCustomData
property has been removed. This is for compatibility with other platforms and more information can be found in the migration guide - Added support for displaying the appearance of readonly text widgets
- Added constants for stamp annotation icon files
Annotations.StampAnnotation.IconNames
- Added the
documentViewer.setDefaultPageColor
API which sets the background color for pages - Added support for symmetric annotation resizing. Holding alt/option and resizing will maintain the center point while resizing in all directions. Holding alt/option and shift while resizing will do the same thing while also maintaining the aspect ratio.
- Improving the zooming behavior so that annotations don't blink when changing the zoom level
- Updated annotation
NoZoom
rendering to be consistent. Now all annotations will properly render with theNoZoom
property set to true. - Added support for the
documentFileName
property in embedded JS - Added support for displaying different checkbox and radio button styles (e.g. circle, square, star, cross, rectangle, diamond)
- Added the
refreshAppearances
API on field objects which will refresh the appearance of each widget associated with that field - When
deselectAllAnnotations
is called, now theannotationSelected
event will return an array of the previously selected annotations, not null - Updated the expected property name of the parameter to
documentViewer.select
to bepageNumber
instead ofpageIndex
- Updated the pageList parameter passed to setPagesUpdatedInternalAnnotationsTransform from 0-indexed page numbers to 1-indexed
Fixes
- Fixed issue where a freetext annotation with a callout intent is treated as a normal freetext if there are no callout line values
- Fixed issue where the measurement value for perimeter and area annotations wasn't being updated as the annotation was created
- Fixed issue where using
DocumentViewer
directly inside an Angular project wouldn't fire iframe loading events properly because of how Angular changes the event handling - Fixed issue where the
documentViewer.setViewportRenderMode
API wasn't working properly - Fixed issue where the text height wasn't calculated properly for freetext annotations in Safari
- Fixed issue where autosized freetext annotations didn't work correctly on rotated pages
- Fixed issue with some embedded JS scripts in IE11
- Fixed issue where undo didn't work in certain cases
- Fixed issue where Firefox and Safari were scaling down checkboxes unnecessarily
- Fixed issue where page open actions for the first page wouldn't fire if the document loaded wasn't the first one
- Fixed issue where signatures with a white background weren't able to be signed
- Fixed issue where freetext annotations could be partially initialized in a bad state programmatically
- Fixed issue where WebViewer was capping the maximum font size for auto-sized text widgets
PDF.js Express UI
New
- Added a "Fill and Sign" toolbar which provides tools to more easily fill and sign documents that don't include fillable forms (e.g. scanned documents)
- The legacy UI will no longer be updated to work with WebViewer Core 8.0 or newer versions
- Added the
UI
namespace on the WebViewer instance object. This namespace includes all UI APIs and constants. - Added the
addEventListener
andremoveEventListener
APIs on theUI
namespace to more easily listen to events fired by the UI. - Added support for viewing, adding and modifying text annotations in reader mode
- Added the
instance.UI.enable/disableDesktopOnlyMode
APIs which prevents the UI from making adjustments to the UI on smaller screens - Changing the freetext fill and stroke will now update the icon color in the UI
- Improved handling of nested and locked layers in the layers panel
- Updated the page navigation component to automatically fade out after a period of inactivity so that it doesn't block the page content. It will return when scrolling or hovering. The
instance.UI.disableFadePageNavigationComponent
API is available if you would like to disable this behavior. - Added support for multiple page selection in the thumbnail panel with shift + click
- Updated extract pages modal to allow the extracted pages to be removed at the same time
- Added support for sorting and filtering by annotation color in the notes panel
- Adjusted the behavior of the annotation style popup so that if there was not enough space on the bottom or top of the annotation it would position itself on whichever side had more space
- Added
instance.UI.disablePageDeletionConfirmationModal
to disable the delete page modal that appears when deleting pages from the thumbnail panel - When dragging more than one file into the thumbnail panel now all files will be merged
- Added support for wildcard matching in configorigin.txt file. This means you can use the
*
character as a wildcard for matching allowed origins. - Added the
selectedThumbnailChanged
event - Added
instance.UI.enable/disableToolDefaultStyleUpdateFromAnnotationPopup
which prevents the default tool styles from updating when annotation styles are changed - Updated the thumbnail panel slider styling to be consistent across browsers
- Added support for disabling zooming with the mouse wheel through
instance.UI.disableFeatures([instance.UI.Feature.MouseWheelZoom])
- Added a cloudy rectangle area measurement tool to the default measurement toolbar
- Removed the "Subject" label in the printed note summary if there was no subject defined on the annotation
Fixes
- Fixed issue with styling header items when the header layout is reversed
- Fixed issue where the rectangle used for cropping was visible in the notes panel
- Fixed issue where enabling the MathSymbols feature didn't also enable the richtext popup
- Fixed issue where the thumbnail panel shows the incorrect text value when only one thumbnail is selected
- Fixed issue where text inside the header ribbon dropdown would overflow in some languages
- Fixed issue where the ribbons wouldn't be centered when more buttons are added to the header
- Fixed issue where in IE you were not able to scroll all the way over horizontally when zoomed in
- Fixed issue where the opacity level of the annotation tools wasn't updated when the annotation was updated