Skip to content

Commit

Permalink
[api-minor] Deprecate the imageLayer functionality
Browse files Browse the repository at this point in the history
This functionality has never been used anywhere in the PDF.js library/viewer itself, since it was added in 2013.
Furthermore this functionality is, and has always been, *completely untested* and also unmaintained.
Finally, there's (at least) one old issue about `appendImage` not returning the correct position; see issue 4182.

All-in-all, it seems that keeping very old, untested, unmaintained, and partially broken code around probably isn't what we want here.
(On the off-chance that any future a11y-work requires getting access to image-positions, it'd likely be much better to re-implement the necessary functionality from scratch and also make sure that it's properly tested from the beginning.)
  • Loading branch information
Snuffleupagus committed Aug 25, 2022
1 parent 4e5fc62 commit 27e367e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
* limitations under the License.
*/

import {
deprecated,
getCurrentTransform,
getCurrentTransformInverse,
getRGB,
PixelsPerInch,
} from "./display_utils.js";
import {
FeatureTest,
FONT_IDENTITY_MATRIX,
Expand All @@ -26,12 +33,6 @@ import {
Util,
warn,
} from "../shared/util.js";
import {
getCurrentTransform,
getCurrentTransformInverse,
getRGB,
PixelsPerInch,
} from "./display_utils.js";
import {
getShadingPattern,
PathType,
Expand Down Expand Up @@ -1184,6 +1185,9 @@ class CanvasGraphics {
this.baseTransform = getCurrentTransform(this.ctx);

if (this.imageLayer) {
deprecated(
"The `imageLayer` functionality will be removed in the future."
);
this.imageLayer.beginLayout();
}
}
Expand Down

0 comments on commit 27e367e

Please sign in to comment.