Skip to content

Commit

Permalink
Update pdf.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Apr 28, 2024
1 parent 135e680 commit a17880d
Show file tree
Hide file tree
Showing 11 changed files with 651 additions and 411 deletions.
20 changes: 11 additions & 9 deletions build/pdf.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,7 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {
});
selectElement.addEventListener("input", event => {
const exportValue = getValue(true);
const change = getValue(false);
storage.setValue(id, {
value: exportValue
});
Expand All @@ -1746,6 +1747,7 @@ class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {
id,
name: "Keystroke",
value: selectedValues,
change,
changeEx: exportValue,
willCommit: false,
commitKey: 1,
Expand Down Expand Up @@ -4321,7 +4323,7 @@ class WorkerTransport {
return promise;
}
getPageIndex(ref) {
if (typeof ref !== "object" || ref === null || !Number.isInteger(ref.num) || ref.num < 0 || !Number.isInteger(ref.gen) || ref.gen < 0) {
if (typeof ref !== "object" || !Number.isInteger(ref?.num) || ref.num < 0 || !Number.isInteger(ref?.gen) || ref.gen < 0) {
return Promise.reject(new Error("Invalid pageIndex request."));
}
return this.messageHandler.sendWithPromise("GetPageIndex", {
Expand Down Expand Up @@ -4654,7 +4656,7 @@ class InternalRenderTask {
}
}
const version = "4.2.0";
const build = "5ad42c1";
const build = "90d4b9c";

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });
Expand Down Expand Up @@ -6008,16 +6010,14 @@ function composeSMask(ctx, smask, layerCtx, layerBox) {
ctx.restore();
}
function getImageSmoothingEnabled(transform, interpolate) {
if (interpolate) {
return true;
}
const scale = util.Util.singularValueDecompose2dScale(transform);
scale[0] = Math.fround(scale[0]);
scale[1] = Math.fround(scale[1]);
const actualScale = Math.fround((globalThis.devicePixelRatio || 1) * display_utils.PixelsPerInch.PDF_TO_CSS_UNITS);
if (interpolate !== undefined) {
return interpolate;
} else if (scale[0] <= actualScale || scale[1] <= actualScale) {
return true;
}
return false;
return scale[0] <= actualScale && scale[1] <= actualScale;
}
const LINE_CAP_STYLES = ["butt", "round", "square"];
const LINE_JOIN_STYLES = ["miter", "round", "bevel"];
Expand Down Expand Up @@ -12374,6 +12374,7 @@ class AnnotationEditor {
};
this.parent.togglePointerEvents(false);
window.addEventListener("pointermove", boundResizerPointermove, pointerMoveOptions);
window.addEventListener("contextmenu", display_utils.noContextMenu);
const savedX = this.x;
const savedY = this.y;
const savedWidth = this.width;
Expand All @@ -12388,6 +12389,7 @@ class AnnotationEditor {
window.removeEventListener("pointerup", pointerUpCallback);
window.removeEventListener("blur", pointerUpCallback);
window.removeEventListener("pointermove", boundResizerPointermove, pointerMoveOptions);
window.removeEventListener("contextmenu", display_utils.noContextMenu);
this.parent.div.style.cursor = savedParentCursor;
this.div.style.cursor = savedCursor;
this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);
Expand Down Expand Up @@ -18267,7 +18269,7 @@ _display_api_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.t


const pdfjsVersion = "4.2.0";
const pdfjsBuild = "5ad42c1";
const pdfjsBuild = "90d4b9c";

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });
Expand Down
2 changes: 1 addition & 1 deletion build/pdf.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/pdf.sandbox.mjs

Large diffs are not rendered by default.

380 changes: 204 additions & 176 deletions build/pdf.worker.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pdf.worker.mjs.map

Large diffs are not rendered by default.

127 changes: 121 additions & 6 deletions web/locale/ar/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ pdfjs-download-button-label = نزّل
pdfjs-bookmark-button =
.title = الصفحة الحالية (عرض URL من الصفحة الحالية)
pdfjs-bookmark-button-label = الصفحة الحالية
# Used in Firefox for Android.
pdfjs-open-in-app-button =
.title = افتح في تطبيق
# Used in Firefox for Android.
# Length of the translation matters since we are in a mobile context, with limited screen estate.
pdfjs-open-in-app-button-label = افتح في تطبيق
## Secondary toolbar and context menu

Expand All @@ -81,6 +75,9 @@ pdfjs-cursor-text-select-tool-button-label = أداة اختيار النص
pdfjs-cursor-hand-tool-button =
.title = فعّل أداة اليد
pdfjs-cursor-hand-tool-button-label = أداة اليد
pdfjs-scroll-page-button =
.title = استخدم تمرير الصفحة
pdfjs-scroll-page-button-label = تمرير الصفحة
pdfjs-scroll-vertical-button =
.title = استخدم التمرير الرأسي
pdfjs-scroll-vertical-button-label = التمرير الرأسي
Expand Down Expand Up @@ -187,6 +184,9 @@ pdfjs-layers-button-label = ‏‏الطبقات
pdfjs-thumbs-button =
.title = اعرض مُصغرات
pdfjs-thumbs-button-label = مُصغّرات
pdfjs-current-outline-item-button =
.title = ابحث عن عنصر المخطّط التفصيلي الحالي
pdfjs-current-outline-item-button-label = عنصر المخطّط التفصيلي الحالي
pdfjs-findbar-button =
.title = ابحث في المستند
pdfjs-findbar-button-label = ابحث
Expand Down Expand Up @@ -220,6 +220,29 @@ pdfjs-find-match-diacritics-checkbox-label = طابِق الحركات
pdfjs-find-entire-word-checkbox-label = كلمات كاملة
pdfjs-find-reached-top = تابعت من الأسفل بعدما وصلت إلى بداية المستند
pdfjs-find-reached-bottom = تابعت من الأعلى بعدما وصلت إلى نهاية المستند
# Variables:
# $current (Number) - the index of the currently active find result
# $total (Number) - the total number of matches in the document
pdfjs-find-match-count =
{ $total ->
[zero] لا مطابقة
[one] { $current } من أصل { $total } مطابقة
[two] { $current } من أصل { $total } مطابقة
[few] { $current } من أصل { $total } مطابقة
[many] { $current } من أصل { $total } مطابقة
*[other] { $current } من أصل { $total } مطابقة
}
# Variables:
# $limit (Number) - the maximum number of matches
pdfjs-find-match-count-limit =
{ $limit ->
[zero] { $limit } مطابقة
[one] أكثر من { $limit } مطابقة
[two] أكثر من { $limit } مطابقة
[few] أكثر من { $limit } مطابقة
[many] أكثر من { $limit } مطابقة
*[other] أكثر من { $limit } مطابقات
}
pdfjs-find-not-found = لا وجود للعبارة
## Predefined zoom values
Expand Down Expand Up @@ -271,19 +294,111 @@ pdfjs-web-fonts-disabled = خطوط الوب مُعطّلة: تعذّر استخ
## Editing

pdfjs-editor-free-text-button =
.title = نص
pdfjs-editor-free-text-button-label = نص
pdfjs-editor-ink-button =
.title = ارسم
pdfjs-editor-ink-button-label = ارسم
pdfjs-editor-stamp-button =
.title = أضِف أو حرّر الصور
pdfjs-editor-stamp-button-label = أضِف أو حرّر الصور
pdfjs-editor-highlight-button =
.title = أبرِز
pdfjs-editor-highlight-button-label = أبرِز
pdfjs-highlight-floating-button =
.title = أبرِز
pdfjs-highlight-floating-button1 =
.title = أبرِز
.aria-label = أبرِز
pdfjs-highlight-floating-button-label = أبرِز
## Remove button for the various kind of editor.

pdfjs-editor-remove-ink-button =
.title = أزِل الرسم
pdfjs-editor-remove-freetext-button =
.title = أزِل النص
pdfjs-editor-remove-stamp-button =
.title = أزِل الصورة
pdfjs-editor-remove-highlight-button =
.title = أزِل الإبراز
##

# Editor Parameters
pdfjs-editor-free-text-color-input = اللون
pdfjs-editor-free-text-size-input = الحجم
pdfjs-editor-ink-color-input = اللون
pdfjs-editor-ink-thickness-input = السماكة
pdfjs-editor-ink-opacity-input = العتامة
pdfjs-editor-stamp-add-image-button =
.title = أضِف صورة
pdfjs-editor-stamp-add-image-button-label = أضِف صورة
# This refers to the thickness of the line used for free highlighting (not bound to text)
pdfjs-editor-free-highlight-thickness-input = السماكة
pdfjs-editor-free-highlight-thickness-title =
.title = غيّر السُمك عند إبراز عناصر أُخرى غير النص
pdfjs-free-text =
.aria-label = محرِّر النص
pdfjs-free-text-default-content = ابدأ الكتابة…
pdfjs-ink =
.aria-label = محرِّر الرسم
pdfjs-ink-canvas =
.aria-label = صورة أنشأها المستخدم
## Alt-text dialog

# Alternative text (alt text) helps when people can't see the image.
pdfjs-editor-alt-text-button-label = نص بديل
pdfjs-editor-alt-text-edit-button-label = تحرير النص البديل
pdfjs-editor-alt-text-dialog-label = اختر خيار
pdfjs-editor-alt-text-dialog-description = يساعد النص البديل عندما لا يتمكن الأشخاص من رؤية الصورة أو عندما لا يتم تحميلها.
pdfjs-editor-alt-text-add-description-label = أضِف وصف
pdfjs-editor-alt-text-add-description-description = استهدف جملتين تصفان الموضوع أو الإعداد أو الإجراءات.
pdfjs-editor-alt-text-mark-decorative-label = علّمها على أنها زخرفية
pdfjs-editor-alt-text-mark-decorative-description = يُستخدم هذا في الصور المزخرفة، مثل الحدود أو العلامات المائية.
pdfjs-editor-alt-text-cancel-button = ألغِ
pdfjs-editor-alt-text-save-button = احفظ
pdfjs-editor-alt-text-decorative-tooltip = عُلّمت على أنها زخرفية
# .placeholder: This is a placeholder for the alt text input area
pdfjs-editor-alt-text-textarea =
.placeholder = على سبيل المثال، "يجلس شاب على الطاولة لتناول وجبة"
## Editor resizers
## This is used in an aria label to help to understand the role of the resizer.

pdfjs-editor-resizer-label-top-left = الزاوية اليُسرى العُليا — غيّر الحجم
pdfjs-editor-resizer-label-top-middle = أعلى الوسط - غيّر الحجم
pdfjs-editor-resizer-label-top-right = الزاوية اليُمنى العُليا - غيّر الحجم
pdfjs-editor-resizer-label-middle-right = اليمين الأوسط - غيّر الحجم
pdfjs-editor-resizer-label-bottom-right = الزاوية اليُمنى السُفلى - غيّر الحجم
pdfjs-editor-resizer-label-bottom-middle = أسفل الوسط - غيّر الحجم
pdfjs-editor-resizer-label-bottom-left = الزاوية اليُسرى السُفلية - غيّر الحجم
pdfjs-editor-resizer-label-middle-left = مُنتصف اليسار - غيّر الحجم
## Color picker

# This means "Color used to highlight text"
pdfjs-editor-highlight-colorpicker-label = أبرِز اللون
pdfjs-editor-colorpicker-button =
.title = غيّر اللون
pdfjs-editor-colorpicker-dropdown =
.aria-label = اختيارات الألوان
pdfjs-editor-colorpicker-yellow =
.title = أصفر
pdfjs-editor-colorpicker-green =
.title = أخضر
pdfjs-editor-colorpicker-blue =
.title = أزرق
pdfjs-editor-colorpicker-pink =
.title = وردي
pdfjs-editor-colorpicker-red =
.title = أحمر
## Show all highlights
## This is a toggle button to show/hide all the highlights.

pdfjs-editor-highlight-show-all-button-label = أظهِر الكل
pdfjs-editor-highlight-show-all-button =
.title = أظهِر الكل
18 changes: 6 additions & 12 deletions web/locale/pt-BR/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ pdfjs-download-button-label = Baixar
pdfjs-bookmark-button =
.title = Página atual (ver URL da página atual)
pdfjs-bookmark-button-label = Pagina atual
# Used in Firefox for Android.
pdfjs-open-in-app-button =
.title = Abrir em um aplicativo
# Used in Firefox for Android.
# Length of the translation matters since we are in a mobile context, with limited screen estate.
pdfjs-open-in-app-button-label = Abrir em um aplicativo
## Secondary toolbar and context menu

Expand Down Expand Up @@ -351,11 +345,11 @@ pdfjs-ink-canvas =
pdfjs-editor-alt-text-button-label = Texto alternativo
pdfjs-editor-alt-text-edit-button-label = Editar texto alternativo
pdfjs-editor-alt-text-dialog-label = Escolha uma opção
pdfjs-editor-alt-text-dialog-description = O texto alternativo ajuda quando uma imagem não aparece ou não for carregada.
pdfjs-editor-alt-text-add-description-label = Adicione uma descrição
pdfjs-editor-alt-text-add-description-description = Procure usar uma ou duas frases que descrevam o assunto, o cenário ou as ações.
pdfjs-editor-alt-text-dialog-description = O texto alternativo ajuda quando uma imagem não aparece ou não é carregada.
pdfjs-editor-alt-text-add-description-label = Adicionar uma descrição
pdfjs-editor-alt-text-add-description-description = Procure usar uma ou duas frases que descrevam o assunto, cenário ou ação.
pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorativa
pdfjs-editor-alt-text-mark-decorative-description = Isto é usado para imagens ornamentais, como bordas ou marcas d'água.
pdfjs-editor-alt-text-mark-decorative-description = Isto é usado em imagens ornamentais, como bordas ou marcas d'água.
pdfjs-editor-alt-text-cancel-button = Cancelar
pdfjs-editor-alt-text-save-button = Salvar
pdfjs-editor-alt-text-decorative-tooltip = Marcado como decorativa
Expand Down Expand Up @@ -397,6 +391,6 @@ pdfjs-editor-colorpicker-red =
## Show all highlights
## This is a toggle button to show/hide all the highlights.

pdfjs-editor-highlight-show-all-button-label = Mostrar tudo
pdfjs-editor-highlight-show-all-button-label = Mostrar todos
pdfjs-editor-highlight-show-all-button =
.title = Mostrar tudo
.title = Mostrar todos
Loading

0 comments on commit a17880d

Please sign in to comment.