-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When annotaion exceeds 10 pages, print and download are abnormal #15780
Comments
Naively, it seems to me that we should probably pdf.js/src/display/editor/annotation_editor_layer.js Lines 513 to 530 in 67e1c37
Similarly, we should probably deserialize any applicable editors when re-constructing the layer in pdf.js/src/display/editor/annotation_editor_layer.js Lines 64 to 82 in 67e1c37
/cc @calixteman, @marco-c This seems like a pretty serious usability issue, and it's possible that this is also the same bug as outlined in https://www.reddit.com/r/firefox/comments/yxlgx3/how_to_actually_save_an_edited_pdf/ |
Good idea.
It's very likely the same issue. |
When printing/saving the created editors are serialized and they're using some properties (e.g. parent viewport, color, ...) which are unavailable because the parent layer has been removed. Consequently, when the parent layer is destroyed we save the serialized version of the editors. It fixes mozilla#15780.
An annotation editor layer can be destroyed when it's invisible, hence some annotations can have a null parent but when printing/saving or when changing font size, color, ... of all added annotations (when selected with ctrl+a) we still need to have some parent properties especially the page dimensions, global scale factor and global rotation angle. This patch aims to remove all the references to the parent in the editor instances except in some cases where an editor should obviously have one. It fixes mozilla#15780.
An annotation editor layer can be destroyed when it's invisible, hence some annotations can have a null parent but when printing/saving or when changing font size, color, ... of all added annotations (when selected with ctrl+a) we still need to have some parent properties especially the page dimensions, global scale factor and global rotation angle. This patch aims to remove all the references to the parent in the editor instances except in some cases where an editor should obviously have one. It fixes mozilla#15780.
An annotation editor layer can be destroyed when it's invisible, hence some annotations can have a null parent but when printing/saving or when changing font size, color, ... of all added annotations (when selected with ctrl+a) we still need to have some parent properties especially the page dimensions, global scale factor and global rotation angle. This patch aims to remove all the references to the parent in the editor instances except in some cases where an editor should obviously have one. It fixes mozilla#15780.
An annotation editor layer can be destroyed when it's invisible, hence some annotations can have a null parent but when printing/saving or when changing font size, color, ... of all added annotations (when selected with ctrl+a) we still need to have some parent properties especially the page dimensions, global scale factor and global rotation angle. This patch aims to remove all the references to the parent in the editor instances except in some cases where an editor should obviously have one. It fixes mozilla#15780.
…#15780 The main issue is due to the fact that an editor's parent can be null when we want to serialize it and that lead to an exception which break all the saving/printing process. So this incomplete patch fixes only the saving/printing issue but not the underlying problem (i.e. having a null parent) and doesn't bring that much complexity, so it should help to uplift it the next Firefox release.
…#15780 The main issue is due to the fact that an editor's parent can be null when we want to serialize it and that lead to an exception which break all the saving/printing process. So this incomplete patch fixes only the saving/printing issue but not the underlying problem (i.e. having a null parent) and doesn't bring that much complexity, so it should help to uplift it the next Firefox release.
[Editor] Add a very basic and incomplete workaround for issue #15780
An annotation editor layer can be destroyed when it's invisible, hence some annotations can have a null parent but when printing/saving or when changing font size, color, ... of all added annotations (when selected with ctrl+a) we still need to have some parent properties especially the page dimensions, global scale factor and global rotation angle. This patch aims to remove all the references to the parent in the editor instances except in some cases where an editor should obviously have one. It fixes mozilla#15780.
An annotation editor layer can be destroyed when it's invisible, hence some annotations can have a null parent but when printing/saving or when changing font size, color, ... of all added annotations (when selected with ctrl+a) we still need to have some parent properties especially the page dimensions, global scale factor and global rotation angle. This patch aims to remove all the references to the parent in the editor instances except in some cases where an editor should obviously have one. It fixes mozilla#15780.
An annotation editor layer can be destroyed when it's invisible, hence some annotations can have a null parent but when printing/saving or when changing font size, color, ... of all added annotations (when selected with ctrl+a) we still need to have some parent properties especially the page dimensions, global scale factor and global rotation angle. This patch aims to remove all the references to the parent in the editor instances except in some cases where an editor should obviously have one. It fixes mozilla#15780.
An annotation editor layer can be destroyed when it's invisible, hence some annotations can have a null parent but when printing/saving or when changing font size, color, ... of all added annotations (when selected with ctrl+a) we still need to have some parent properties especially the page dimensions, global scale factor and global rotation angle. This patch aims to remove all the references to the parent in the editor instances except in some cases where an editor should obviously have one. It fixes mozilla#15780.
Attach (recommended) or Link to PDF file here: https://mozilla.github.io/pdf.js/legacy/web/viewer.html
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
print with annotation
What went wrong? (add screenshot)
report error:
editor.js:298 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'viewportBaseDimensions')
at InkEditor.getRect (editor.js:298:53)
at InkEditor.serialize (ink.js:1065:23)
at get serializable [as serializable] (annotation_storage.js:168:47)
at new PrintAnnotationStorage (annotation_storage.js:204:49)
at get print [as print] (annotation_storage.js:153:12)
at app.js:1683:52
at async Promise.all (index 1)
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
https://mozilla.github.io/pdf.js/legacy/web/viewer.html
The text was updated successfully, but these errors were encountered: