mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
[Editor] Allow to edit FreeText annotations
This commit is contained in:
parent
a37f7d2477
commit
0116a8f484
8 changed files with 459 additions and 39 deletions
|
@ -134,3 +134,21 @@ const mockClipboard = async pages => {
|
|||
);
|
||||
};
|
||||
exports.mockClipboard = mockClipboard;
|
||||
|
||||
const getSerialized = page =>
|
||||
page.evaluate(() => [
|
||||
...window.PDFViewerApplication.pdfDocument.annotationStorage.serializable.values(),
|
||||
]);
|
||||
exports.getSerialized = getSerialized;
|
||||
|
||||
function getEditors(page, kind) {
|
||||
return page.evaluate(aKind => {
|
||||
const elements = document.querySelectorAll(`.${aKind}Editor`);
|
||||
const results = [];
|
||||
for (const { id } of elements) {
|
||||
results.push(id);
|
||||
}
|
||||
return results;
|
||||
}, kind);
|
||||
}
|
||||
exports.getEditors = getEditors;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue