kviewer 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/module.d.mts +8 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +25 -3
- package/dist/runtime/annotation/engine/canvas-resolution.d.ts +7 -0
- package/dist/runtime/annotation/engine/canvas-resolution.js +21 -0
- package/dist/runtime/annotation/engine/editor/editor.d.ts +7 -2
- package/dist/runtime/annotation/engine/editor/editor.js +14 -0
- package/dist/runtime/annotation/engine/editor/selector.d.ts +13 -1
- package/dist/runtime/annotation/engine/editor/selector.js +60 -8
- package/dist/runtime/annotation/engine/import-normalize.js +3 -3
- package/dist/runtime/annotation/engine/painter.d.ts +33 -2
- package/dist/runtime/annotation/engine/painter.js +88 -2
- package/dist/runtime/annotation/engine/store.js +3 -0
- package/dist/runtime/annotation/engine/tools/arrow.js +0 -1
- package/dist/runtime/annotation/engine/tools/circle.js +0 -2
- package/dist/runtime/annotation/engine/tools/free-highlight.js +0 -2
- package/dist/runtime/annotation/engine/tools/freehand.js +0 -2
- package/dist/runtime/annotation/engine/tools/rectangle.js +0 -2
- package/dist/runtime/annotation/engine/types.d.ts +9 -2
- package/dist/runtime/annotation/font-style.d.ts +15 -0
- package/dist/runtime/annotation/font-style.js +19 -0
- package/dist/runtime/annotation/parsers/extractCheckboxStyles.d.ts +8 -0
- package/dist/runtime/annotation/parsers/extractCheckboxStyles.js +24 -1
- package/dist/runtime/annotation/pdf-export/annotation-flags.d.ts +8 -0
- package/dist/runtime/annotation/pdf-export/annotation-flags.js +5 -0
- package/dist/runtime/annotation/pdf-export/export-form-fields.js +3 -1
- package/dist/runtime/annotation/pdf-export/export.js +17 -4
- package/dist/runtime/annotation/pdf-export/parse.d.ts +22 -1
- package/dist/runtime/annotation/pdf-export/parse.js +32 -2
- package/dist/runtime/annotation/pdf-export/parse_circle.js +5 -5
- package/dist/runtime/annotation/pdf-export/parse_freetext.js +33 -24
- package/dist/runtime/annotation/pdf-export/parse_highlight.js +5 -5
- package/dist/runtime/annotation/pdf-export/parse_ink.js +7 -6
- package/dist/runtime/annotation/pdf-export/parse_line.js +7 -6
- package/dist/runtime/annotation/pdf-export/parse_polyline.js +7 -6
- package/dist/runtime/annotation/pdf-export/parse_square.js +5 -5
- package/dist/runtime/annotation/pdf-export/parse_stamp.js +6 -7
- package/dist/runtime/annotation/pdf-export/parse_strikeout.js +5 -5
- package/dist/runtime/annotation/pdf-export/parse_text.js +5 -5
- package/dist/runtime/annotation/pdf-export/parse_underline.js +5 -5
- package/dist/runtime/annotation/pdf-export/unicode-font.d.ts +5 -0
- package/dist/runtime/annotation/pdf-export/unicode-font.js +31 -0
- package/dist/runtime/annotation/pdf-export/winansi.d.ts +17 -0
- package/dist/runtime/annotation/pdf-export/winansi.js +77 -0
- package/dist/runtime/annotation/pdf-import/decode_circle.js +0 -1
- package/dist/runtime/annotation/pdf-import/decode_ink.js +0 -1
- package/dist/runtime/annotation/pdf-import/decode_line.js +0 -1
- package/dist/runtime/annotation/pdf-import/decode_square.js +0 -1
- package/dist/runtime/annotation/pdf-import/extract_stamp_appearance.d.ts +12 -0
- package/dist/runtime/annotation/pdf-import/extract_stamp_appearance.js +17 -4
- package/dist/runtime/annotation/pdf-import/types.d.ts +2 -0
- package/dist/runtime/assets/fonts/LICENSE-LiberationSans +102 -0
- package/dist/runtime/assets/fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/runtime/assets/kviewer.css +1 -1
- package/dist/runtime/components/AnnotationToolbar.vue +6 -4
- package/dist/runtime/components/PdfPage.d.vue.ts +16 -0
- package/dist/runtime/components/PdfPage.vue +170 -9
- package/dist/runtime/components/PdfPage.vue.d.ts +16 -0
- package/dist/runtime/components/PerfHud.d.vue.ts +3 -0
- package/dist/runtime/components/PerfHud.vue +97 -0
- package/dist/runtime/components/PerfHud.vue.d.ts +3 -0
- package/dist/runtime/components/ToolButton.vue +4 -1
- package/dist/runtime/components/Viewer.d.vue.ts +25 -2
- package/dist/runtime/components/Viewer.vue +174 -12
- package/dist/runtime/components/Viewer.vue.d.ts +25 -2
- package/dist/runtime/components/ViewerBar.d.vue.ts +21 -1
- package/dist/runtime/components/ViewerBar.vue +183 -101
- package/dist/runtime/components/ViewerBar.vue.d.ts +21 -1
- package/dist/runtime/components/ViewerTabs.d.vue.ts +10 -2
- package/dist/runtime/components/ViewerTabs.vue +13 -2
- package/dist/runtime/components/ViewerTabs.vue.d.ts +10 -2
- package/dist/runtime/components/form-fields/FormDropdown.vue +50 -19
- package/dist/runtime/components/form-fields/FormSignatureField.vue +4 -2
- package/dist/runtime/components/form-fields/FormTextField.vue +7 -18
- package/dist/runtime/components/modals/FreeTextModal.vue +6 -4
- package/dist/runtime/components/modals/SignatureDrawModal.vue +6 -4
- package/dist/runtime/components/panels/PlacedFieldSidebar.vue +67 -50
- package/dist/runtime/components/panels/SignaturePicker.vue +6 -4
- package/dist/runtime/components/panels/StampPicker.vue +3 -1
- package/dist/runtime/components/tools/AnnotationToolButton.d.vue.ts +10 -0
- package/dist/runtime/components/tools/AnnotationToolButton.vue +33 -0
- package/dist/runtime/components/tools/AnnotationToolButton.vue.d.ts +10 -0
- package/dist/runtime/components/tools/MarqueeTool.vue +3 -1
- package/dist/runtime/components/tools/PageSettings.vue +13 -11
- package/dist/runtime/components/tools/SearchTool.vue +12 -10
- package/dist/runtime/components/tools/ToolProperties.vue +7 -5
- package/dist/runtime/components/tools/ToolbarMenu.d.vue.ts +9 -0
- package/dist/runtime/components/tools/ToolbarMenu.vue +79 -0
- package/dist/runtime/components/tools/ToolbarMenu.vue.d.ts +9 -0
- package/dist/runtime/components/tools/ZoomControls.vue +17 -9
- package/dist/runtime/composables/canvas-limits.d.ts +22 -0
- package/dist/runtime/composables/canvas-limits.js +10 -0
- package/dist/runtime/composables/useAnnotationEngine.js +3 -1
- package/dist/runtime/composables/useFormFields.d.ts +6 -0
- package/dist/runtime/composables/useFormFields.js +28 -0
- package/dist/runtime/composables/useInertiaPanzoom.d.ts +10 -0
- package/dist/runtime/composables/useInertiaPanzoom.js +57 -10
- package/dist/runtime/composables/useKviewerI18n.d.ts +18 -0
- package/dist/runtime/composables/useKviewerI18n.js +29 -0
- package/dist/runtime/composables/useScriptingManager.d.ts +8 -4
- package/dist/runtime/composables/useScriptingManager.js +2 -0
- package/dist/runtime/composables/useViewerState.d.ts +4 -0
- package/dist/runtime/composables/useViewerState.js +8 -0
- package/dist/runtime/i18n/messages.d.ts +252 -0
- package/dist/runtime/i18n/messages.js +249 -0
- package/dist/runtime/public-types.d.ts +2 -0
- package/dist/runtime/toolbar-tools.d.ts +54 -0
- package/dist/runtime/toolbar-tools.js +79 -0
- package/dist/types.d.mts +1 -1
- package/package.json +14 -31
|
@@ -3,7 +3,7 @@ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "
|
|
|
3
3
|
import { convertCanvasPointToPdf, pageTransformFromPdfLibPage } from "../pdf-import/transform.js";
|
|
4
4
|
import { AnnotationParser } from "./parse.js";
|
|
5
5
|
import { computeBoundsFromKonvaString } from "./parse_utils.js";
|
|
6
|
-
|
|
6
|
+
import { PRINT_FLAG } from "./annotation-flags.js";
|
|
7
7
|
function parseSvgPathToPoints(data) {
|
|
8
8
|
const commands = data.match(/[a-z][^a-z]*/gi) || [];
|
|
9
9
|
const points = [];
|
|
@@ -51,7 +51,8 @@ export class PolylineParser extends AnnotationParser {
|
|
|
51
51
|
})
|
|
52
52
|
);
|
|
53
53
|
const firstLine = lines[0]?.attrs || {};
|
|
54
|
-
const
|
|
54
|
+
const strokeScale = (Math.abs(scaleX) + Math.abs(scaleY)) / 2;
|
|
55
|
+
const strokeWidth = (firstLine.strokeWidth ?? 1) * strokeScale;
|
|
55
56
|
const opacity = firstLine.opacity ?? 1;
|
|
56
57
|
const color = firstLine.stroke ?? annotation.color ?? "rgb(255, 0, 0)";
|
|
57
58
|
const [r, g, b] = rgbToPdfColor(color);
|
|
@@ -62,14 +63,14 @@ export class PolylineParser extends AnnotationParser {
|
|
|
62
63
|
const mainAnn = context.obj({
|
|
63
64
|
Type: PDFName.of("Annot"),
|
|
64
65
|
Subtype: PDFName.of("Ink"),
|
|
66
|
+
F: PRINT_FLAG,
|
|
65
67
|
// Compute Rect from konvaString so it reflects the current position
|
|
66
68
|
// even when konvaClientRect is stale after a move/resize.
|
|
67
69
|
Rect: convertKonvaRectToPdfRect(computeBoundsFromKonvaString(annotation.konvaString) ?? annotation.konvaClientRect, pageTransform),
|
|
68
70
|
InkList: inkList,
|
|
69
71
|
C: context.obj([PDFNumber.of(r), PDFNumber.of(g), PDFNumber.of(b)]),
|
|
70
|
-
|
|
72
|
+
...this.ownerDateEntries(annotation.title, annotation.date),
|
|
71
73
|
Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
|
|
72
|
-
M: PDFString.of(annotation.date || ""),
|
|
73
74
|
NM: PDFString.of(annotation.id),
|
|
74
75
|
Border: context.obj([0, 0, 0]),
|
|
75
76
|
BS: bs,
|
|
@@ -81,10 +82,10 @@ export class PolylineParser extends AnnotationParser {
|
|
|
81
82
|
const replyAnn = context.obj({
|
|
82
83
|
Type: PDFName.of("Annot"),
|
|
83
84
|
Subtype: PDFName.of("Text"),
|
|
85
|
+
F: PRINT_FLAG,
|
|
84
86
|
Rect: convertKonvaRectToPdfRect(computeBoundsFromKonvaString(annotation.konvaString) ?? annotation.konvaClientRect, pageTransform),
|
|
85
87
|
Contents: stringToPDFHexString(comment.content),
|
|
86
|
-
|
|
87
|
-
M: PDFString.of(comment.date || ""),
|
|
88
|
+
...this.ownerDateEntries(comment.title, comment.date),
|
|
88
89
|
C: context.obj([PDFNumber.of(r), PDFNumber.of(g), PDFNumber.of(b)]),
|
|
89
90
|
IRT: mainAnnRef,
|
|
90
91
|
RT: PDFName.of("R"),
|
|
@@ -3,7 +3,7 @@ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "
|
|
|
3
3
|
import { pageTransformFromPdfLibPage } from "../pdf-import/transform.js";
|
|
4
4
|
import { AnnotationParser } from "./parse.js";
|
|
5
5
|
import { computeBoundsFromKonvaString } from "./parse_utils.js";
|
|
6
|
-
|
|
6
|
+
import { PRINT_FLAG } from "./annotation-flags.js";
|
|
7
7
|
export class SquareParser extends AnnotationParser {
|
|
8
8
|
async parse() {
|
|
9
9
|
const { annotation, page, pdfDoc } = this;
|
|
@@ -14,11 +14,11 @@ export class SquareParser extends AnnotationParser {
|
|
|
14
14
|
const mainAnn = context.obj({
|
|
15
15
|
Type: PDFName.of("Annot"),
|
|
16
16
|
Subtype: PDFName.of("Square"),
|
|
17
|
+
F: PRINT_FLAG,
|
|
17
18
|
Rect: rect,
|
|
18
19
|
C: rgbToPdfColor(annotation.color || void 0),
|
|
19
|
-
|
|
20
|
+
...this.ownerDateEntries(annotation.title, annotation.date),
|
|
20
21
|
Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
|
|
21
|
-
M: PDFString.of(annotation.date || ""),
|
|
22
22
|
NM: PDFString.of(annotation.id),
|
|
23
23
|
Border: [0, 0, 1]
|
|
24
24
|
});
|
|
@@ -28,10 +28,10 @@ export class SquareParser extends AnnotationParser {
|
|
|
28
28
|
const replyAnn = context.obj({
|
|
29
29
|
Type: PDFName.of("Annot"),
|
|
30
30
|
Subtype: PDFName.of("Text"),
|
|
31
|
+
F: PRINT_FLAG,
|
|
31
32
|
Rect: rect,
|
|
32
33
|
Contents: stringToPDFHexString(comment.content),
|
|
33
|
-
|
|
34
|
-
M: PDFString.of(comment.date || ""),
|
|
34
|
+
...this.ownerDateEntries(comment.title, comment.date),
|
|
35
35
|
C: rgbToPdfColor(annotation.color || void 0),
|
|
36
36
|
IRT: mainAnnRef,
|
|
37
37
|
RT: PDFName.of("R"),
|
|
@@ -3,7 +3,7 @@ import { convertKonvaRectToPdfRect, stringToPDFHexString } from "../engine/utils
|
|
|
3
3
|
import { pageTransformFromPdfLibPage } from "../pdf-import/transform.js";
|
|
4
4
|
import { AnnotationParser } from "./parse.js";
|
|
5
5
|
import { computeBoundsFromKonvaString, formAppearanceMatrix } from "./parse_utils.js";
|
|
6
|
-
|
|
6
|
+
import { PRINT_FLAG, PRINT_LOCKED_FLAG } from "./annotation-flags.js";
|
|
7
7
|
const SVG_RASTER_SCALE = 4;
|
|
8
8
|
const MAX_RASTER_EDGE = 4096;
|
|
9
9
|
function extractBase64Image(dataUrl) {
|
|
@@ -170,13 +170,12 @@ export class StampParser extends AnnotationParser {
|
|
|
170
170
|
const stampAnnDict = {
|
|
171
171
|
Type: PDFName.of("Annot"),
|
|
172
172
|
Subtype: PDFName.of("Stamp"),
|
|
173
|
+
F: PRINT_LOCKED_FLAG,
|
|
173
174
|
Rect: rect,
|
|
174
175
|
NM: PDFString.of(annotation.id),
|
|
175
176
|
Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
Open: false,
|
|
179
|
-
F: PDFNumber.of(128)
|
|
177
|
+
...this.ownerDateEntries(annotation.title, annotation.date),
|
|
178
|
+
Open: false
|
|
180
179
|
};
|
|
181
180
|
if (apDict) {
|
|
182
181
|
stampAnnDict.AP = apDict;
|
|
@@ -188,10 +187,10 @@ export class StampParser extends AnnotationParser {
|
|
|
188
187
|
const replyAnn = context.obj({
|
|
189
188
|
Type: PDFName.of("Annot"),
|
|
190
189
|
Subtype: PDFName.of("Text"),
|
|
190
|
+
F: PRINT_FLAG,
|
|
191
191
|
Rect: convertKonvaRectToPdfRect(bounds ?? annotation.konvaClientRect, pageTransform),
|
|
192
192
|
Contents: stringToPDFHexString(comment.content),
|
|
193
|
-
|
|
194
|
-
M: PDFString.of(comment.date || ""),
|
|
193
|
+
...this.ownerDateEntries(comment.title, comment.date),
|
|
195
194
|
IRT: stampAnnRef,
|
|
196
195
|
RT: PDFName.of("R"),
|
|
197
196
|
NM: PDFString.of(comment.id),
|
|
@@ -2,7 +2,7 @@ import { PDFName, PDFString } from "pdf-lib";
|
|
|
2
2
|
import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "../engine/utils.js";
|
|
3
3
|
import { convertCanvasPointToPdf, pageTransformFromPdfLibPage } from "../pdf-import/transform.js";
|
|
4
4
|
import { AnnotationParser } from "./parse.js";
|
|
5
|
-
|
|
5
|
+
import { PRINT_FLAG } from "./annotation-flags.js";
|
|
6
6
|
function buildQuadPoints(konvaString, t) {
|
|
7
7
|
const konvaGroup = JSON.parse(konvaString);
|
|
8
8
|
const rects = (konvaGroup.children ?? []).filter((item) => item.className === "Rect");
|
|
@@ -29,12 +29,12 @@ export class StrikeOutParser extends AnnotationParser {
|
|
|
29
29
|
const mainAnn = context.obj({
|
|
30
30
|
Type: PDFName.of("Annot"),
|
|
31
31
|
Subtype: PDFName.of("StrikeOut"),
|
|
32
|
+
F: PRINT_FLAG,
|
|
32
33
|
Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageTransform),
|
|
33
34
|
QuadPoints: quadPoints,
|
|
34
35
|
C: rgbToPdfColor(annotation.color || void 0),
|
|
35
|
-
|
|
36
|
+
...this.ownerDateEntries(annotation.title, annotation.date),
|
|
36
37
|
Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
|
|
37
|
-
M: PDFString.of(annotation.date || ""),
|
|
38
38
|
NM: PDFString.of(annotation.id)
|
|
39
39
|
});
|
|
40
40
|
const mainAnnRef = context.register(mainAnn);
|
|
@@ -43,10 +43,10 @@ export class StrikeOutParser extends AnnotationParser {
|
|
|
43
43
|
const replyAnn = context.obj({
|
|
44
44
|
Type: PDFName.of("Annot"),
|
|
45
45
|
Subtype: PDFName.of("Text"),
|
|
46
|
+
F: PRINT_FLAG,
|
|
46
47
|
Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageTransform),
|
|
47
48
|
Contents: stringToPDFHexString(comment.content),
|
|
48
|
-
|
|
49
|
-
M: PDFString.of(comment.date || ""),
|
|
49
|
+
...this.ownerDateEntries(comment.title, comment.date),
|
|
50
50
|
C: rgbToPdfColor(annotation.color || void 0),
|
|
51
51
|
IRT: mainAnnRef,
|
|
52
52
|
RT: PDFName.of("R"),
|
|
@@ -3,7 +3,7 @@ import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "
|
|
|
3
3
|
import { pageTransformFromPdfLibPage } from "../pdf-import/transform.js";
|
|
4
4
|
import { AnnotationParser } from "./parse.js";
|
|
5
5
|
import { computeBoundsFromKonvaString } from "./parse_utils.js";
|
|
6
|
-
|
|
6
|
+
import { PRINT_FLAG } from "./annotation-flags.js";
|
|
7
7
|
export class TextParser extends AnnotationParser {
|
|
8
8
|
async parse() {
|
|
9
9
|
const { annotation, page, pdfDoc } = this;
|
|
@@ -14,12 +14,12 @@ export class TextParser extends AnnotationParser {
|
|
|
14
14
|
const mainAnn = context.obj({
|
|
15
15
|
Type: PDFName.of("Annot"),
|
|
16
16
|
Subtype: PDFName.of("Text"),
|
|
17
|
+
F: PRINT_FLAG,
|
|
17
18
|
Rect: rect,
|
|
18
19
|
NM: PDFString.of(annotation.id),
|
|
19
20
|
Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
|
|
20
21
|
Name: PDFName.of("Comment"),
|
|
21
|
-
|
|
22
|
-
M: PDFString.of(annotation.date || ""),
|
|
22
|
+
...this.ownerDateEntries(annotation.title, annotation.date),
|
|
23
23
|
C: rgbToPdfColor(annotation.color || void 0),
|
|
24
24
|
Open: false
|
|
25
25
|
});
|
|
@@ -29,10 +29,10 @@ export class TextParser extends AnnotationParser {
|
|
|
29
29
|
const replyAnn = context.obj({
|
|
30
30
|
Type: PDFName.of("Annot"),
|
|
31
31
|
Subtype: PDFName.of("Text"),
|
|
32
|
+
F: PRINT_FLAG,
|
|
32
33
|
Rect: rect,
|
|
33
34
|
Contents: stringToPDFHexString(comment.content),
|
|
34
|
-
|
|
35
|
-
M: PDFString.of(comment.date || ""),
|
|
35
|
+
...this.ownerDateEntries(comment.title, comment.date),
|
|
36
36
|
C: rgbToPdfColor(annotation.color || void 0),
|
|
37
37
|
IRT: mainAnnRef,
|
|
38
38
|
RT: PDFName.of("R"),
|
|
@@ -2,7 +2,7 @@ import { PDFName, PDFString } from "pdf-lib";
|
|
|
2
2
|
import { convertKonvaRectToPdfRect, rgbToPdfColor, stringToPDFHexString } from "../engine/utils.js";
|
|
3
3
|
import { convertCanvasPointToPdf, pageTransformFromPdfLibPage } from "../pdf-import/transform.js";
|
|
4
4
|
import { AnnotationParser } from "./parse.js";
|
|
5
|
-
|
|
5
|
+
import { PRINT_FLAG } from "./annotation-flags.js";
|
|
6
6
|
function buildQuadPoints(konvaString, t) {
|
|
7
7
|
const konvaGroup = JSON.parse(konvaString);
|
|
8
8
|
const rects = (konvaGroup.children ?? []).filter((item) => item.className === "Rect");
|
|
@@ -29,12 +29,12 @@ export class UnderlineParser extends AnnotationParser {
|
|
|
29
29
|
const mainAnn = context.obj({
|
|
30
30
|
Type: PDFName.of("Annot"),
|
|
31
31
|
Subtype: PDFName.of("Underline"),
|
|
32
|
+
F: PRINT_FLAG,
|
|
32
33
|
Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageTransform),
|
|
33
34
|
QuadPoints: quadPoints,
|
|
34
35
|
C: rgbToPdfColor(annotation.color || void 0),
|
|
35
|
-
|
|
36
|
+
...this.ownerDateEntries(annotation.title, annotation.date),
|
|
36
37
|
Contents: stringToPDFHexString(annotation.contentsObj?.text || ""),
|
|
37
|
-
M: PDFString.of(annotation.date || ""),
|
|
38
38
|
NM: PDFString.of(annotation.id)
|
|
39
39
|
});
|
|
40
40
|
const mainAnnRef = context.register(mainAnn);
|
|
@@ -43,10 +43,10 @@ export class UnderlineParser extends AnnotationParser {
|
|
|
43
43
|
const replyAnn = context.obj({
|
|
44
44
|
Type: PDFName.of("Annot"),
|
|
45
45
|
Subtype: PDFName.of("Text"),
|
|
46
|
+
F: PRINT_FLAG,
|
|
46
47
|
Rect: convertKonvaRectToPdfRect(annotation.konvaClientRect, pageTransform),
|
|
47
48
|
Contents: stringToPDFHexString(comment.content),
|
|
48
|
-
|
|
49
|
-
M: PDFString.of(comment.date || ""),
|
|
49
|
+
...this.ownerDateEntries(comment.title, comment.date),
|
|
50
50
|
C: rgbToPdfColor(annotation.color || void 0),
|
|
51
51
|
IRT: mainAnnRef,
|
|
52
52
|
RT: PDFName.of("R"),
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PDFDocument, PDFFont } from 'pdf-lib';
|
|
2
|
+
/** Test/SSR hook: replace how the raw font bytes are obtained. */
|
|
3
|
+
export declare function setUnicodeFontLoader(loader: () => Promise<Uint8Array>): void;
|
|
4
|
+
/** Get (or embed once) the Unicode fallback font for this document. */
|
|
5
|
+
export declare function getUnicodeFont(pdfDoc: PDFDocument): Promise<PDFFont>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import fontkit from "@pdf-lib/fontkit";
|
|
2
|
+
let fontBytesPromise = null;
|
|
3
|
+
let loadFontBytes = async () => {
|
|
4
|
+
const { default: fontUrl } = await import(
|
|
5
|
+
// @ts-expect-error -- Vite asset import, no type declaration
|
|
6
|
+
"../../assets/fonts/LiberationSans-Regular.ttf?url"
|
|
7
|
+
);
|
|
8
|
+
const response = await fetch(fontUrl);
|
|
9
|
+
if (!response.ok) {
|
|
10
|
+
throw new Error(`Failed to load Unicode fallback font (${response.status})`);
|
|
11
|
+
}
|
|
12
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
13
|
+
};
|
|
14
|
+
export function setUnicodeFontLoader(loader) {
|
|
15
|
+
loadFontBytes = loader;
|
|
16
|
+
fontBytesPromise = null;
|
|
17
|
+
}
|
|
18
|
+
const fontCache = /* @__PURE__ */ new WeakMap();
|
|
19
|
+
export function getUnicodeFont(pdfDoc) {
|
|
20
|
+
let cached = fontCache.get(pdfDoc);
|
|
21
|
+
if (!cached) {
|
|
22
|
+
cached = (async () => {
|
|
23
|
+
fontBytesPromise ??= loadFontBytes();
|
|
24
|
+
const bytes = await fontBytesPromise;
|
|
25
|
+
pdfDoc.registerFontkit(fontkit);
|
|
26
|
+
return pdfDoc.embedFont(bytes, { subset: true });
|
|
27
|
+
})();
|
|
28
|
+
fontCache.set(pdfDoc, cached);
|
|
29
|
+
}
|
|
30
|
+
return cached;
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WinAnsiEncoding (≈ Windows-1252) helpers.
|
|
3
|
+
*
|
|
4
|
+
* PDF standard fonts (Helvetica & friends) declared with WinAnsiEncoding
|
|
5
|
+
* can only show characters from CP1252. Appearance-stream text must be
|
|
6
|
+
* written as CP1252 BYTES — encoding it as UTF-8 (TextEncoder) turns
|
|
7
|
+
* "ü" into "ü" in every viewer. Text outside CP1252 (€-adjacent
|
|
8
|
+
* symbols already in, but ą, ł, 日 … not) needs an embedded Unicode font.
|
|
9
|
+
*/
|
|
10
|
+
/** True when every character of `text` exists in WinAnsi/CP1252. */
|
|
11
|
+
export declare function isWinAnsiEncodable(text: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Encode a string as CP1252 bytes for a PDF content stream.
|
|
14
|
+
* Unencodable characters are replaced with '?' — callers should check
|
|
15
|
+
* isWinAnsiEncodable() first and use an embedded font instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare function encodeWinAnsi(text: string): Uint8Array;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const CP1252_SPECIALS = /* @__PURE__ */ new Map([
|
|
2
|
+
[8364, 128],
|
|
3
|
+
// €
|
|
4
|
+
[8218, 130],
|
|
5
|
+
// ‚
|
|
6
|
+
[402, 131],
|
|
7
|
+
// ƒ
|
|
8
|
+
[8222, 132],
|
|
9
|
+
// „
|
|
10
|
+
[8230, 133],
|
|
11
|
+
// …
|
|
12
|
+
[8224, 134],
|
|
13
|
+
// †
|
|
14
|
+
[8225, 135],
|
|
15
|
+
// ‡
|
|
16
|
+
[710, 136],
|
|
17
|
+
// ˆ
|
|
18
|
+
[8240, 137],
|
|
19
|
+
// ‰
|
|
20
|
+
[352, 138],
|
|
21
|
+
// Š
|
|
22
|
+
[8249, 139],
|
|
23
|
+
// ‹
|
|
24
|
+
[338, 140],
|
|
25
|
+
// Œ
|
|
26
|
+
[381, 142],
|
|
27
|
+
// Ž
|
|
28
|
+
[8216, 145],
|
|
29
|
+
// '
|
|
30
|
+
[8217, 146],
|
|
31
|
+
// '
|
|
32
|
+
[8220, 147],
|
|
33
|
+
// "
|
|
34
|
+
[8221, 148],
|
|
35
|
+
// "
|
|
36
|
+
[8226, 149],
|
|
37
|
+
// •
|
|
38
|
+
[8211, 150],
|
|
39
|
+
// –
|
|
40
|
+
[8212, 151],
|
|
41
|
+
// —
|
|
42
|
+
[732, 152],
|
|
43
|
+
// ˜
|
|
44
|
+
[8482, 153],
|
|
45
|
+
// ™
|
|
46
|
+
[353, 154],
|
|
47
|
+
// š
|
|
48
|
+
[8250, 155],
|
|
49
|
+
// ›
|
|
50
|
+
[339, 156],
|
|
51
|
+
// œ
|
|
52
|
+
[382, 158],
|
|
53
|
+
// ž
|
|
54
|
+
[376, 159]
|
|
55
|
+
// Ÿ
|
|
56
|
+
]);
|
|
57
|
+
function winAnsiByte(codePoint) {
|
|
58
|
+
if (codePoint <= 127) return codePoint;
|
|
59
|
+
if (codePoint >= 160 && codePoint <= 255) return codePoint;
|
|
60
|
+
return CP1252_SPECIALS.get(codePoint) ?? null;
|
|
61
|
+
}
|
|
62
|
+
export function isWinAnsiEncodable(text) {
|
|
63
|
+
for (const char of text) {
|
|
64
|
+
if (winAnsiByte(char.codePointAt(0)) === null) return false;
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
export function encodeWinAnsi(text) {
|
|
69
|
+
const bytes = [];
|
|
70
|
+
for (const char of text) {
|
|
71
|
+
bytes.push(
|
|
72
|
+
winAnsiByte(char.codePointAt(0)) ?? 63
|
|
73
|
+
/* ? */
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return new Uint8Array(bytes);
|
|
77
|
+
}
|
|
@@ -4,6 +4,9 @@ import { type RawPdfAnnotation, type StampAppearance } from './types.js';
|
|
|
4
4
|
export interface StampExtractionOptions {
|
|
5
5
|
scale?: number;
|
|
6
6
|
diffThreshold?: number;
|
|
7
|
+
/** Skip annotations whose appearance changes no pixels instead of
|
|
8
|
+
* falling back to the raw crop (which would capture page content). */
|
|
9
|
+
skipEmptyDiff?: boolean;
|
|
7
10
|
}
|
|
8
11
|
export interface PixelBounds {
|
|
9
12
|
x: number;
|
|
@@ -22,3 +25,12 @@ export declare function applyMaskOrFallback(annotated: Uint8ClampedArray, mask:
|
|
|
22
25
|
usedMask: boolean;
|
|
23
26
|
};
|
|
24
27
|
export declare function extractStampAppearancesForPage(page: PDFPageProxy, pageTransform: PageTransform, annotations: RawPdfAnnotation[], options?: StampExtractionOptions): Promise<Map<string, StampAppearance>>;
|
|
28
|
+
/**
|
|
29
|
+
* Extract the rendered appearance of signature widgets on a page. The
|
|
30
|
+
* page canvas renders with annotations disabled, so a signature stamp
|
|
31
|
+
* already present in the source PDF is invisible behind the interactive
|
|
32
|
+
* form layer without this. Widgets whose appearance draws nothing (e.g.
|
|
33
|
+
* unsigned fields with an empty `/AP`) are skipped — callers decide
|
|
34
|
+
* which fields are actually signed via the AcroForm `/V` side-channel.
|
|
35
|
+
*/
|
|
36
|
+
export declare function extractSignedSignatureAppearancesForPage(page: PDFPageProxy, pageTransform: PageTransform, annotations: RawPdfAnnotation[], options?: StampExtractionOptions): Promise<Map<string, StampAppearance>>;
|
|
@@ -95,11 +95,23 @@ async function renderPageToCanvas(page, canvas, annotationMode, scale) {
|
|
|
95
95
|
await task.promise;
|
|
96
96
|
}
|
|
97
97
|
export async function extractStampAppearancesForPage(page, pageTransform, annotations, options = {}) {
|
|
98
|
-
const appearances = /* @__PURE__ */ new Map();
|
|
99
98
|
const stampAnnotations = annotations.filter(
|
|
100
99
|
(annotation) => annotation.annotationType === PdfjsAnnotationType.STAMP && typeof annotation.id === "string"
|
|
101
100
|
);
|
|
102
|
-
|
|
101
|
+
return extractAppearancesForAnnotations(page, pageTransform, stampAnnotations, options);
|
|
102
|
+
}
|
|
103
|
+
export async function extractSignedSignatureAppearancesForPage(page, pageTransform, annotations, options = {}) {
|
|
104
|
+
const signedWidgets = annotations.filter(
|
|
105
|
+
(annotation) => annotation.annotationType === PdfjsAnnotationType.WIDGET && typeof annotation.id === "string" && annotation.fieldType === "Sig"
|
|
106
|
+
);
|
|
107
|
+
return extractAppearancesForAnnotations(page, pageTransform, signedWidgets, {
|
|
108
|
+
...options,
|
|
109
|
+
skipEmptyDiff: true
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
async function extractAppearancesForAnnotations(page, pageTransform, targetAnnotations, options = {}) {
|
|
113
|
+
const appearances = /* @__PURE__ */ new Map();
|
|
114
|
+
if (targetAnnotations.length === 0) return appearances;
|
|
103
115
|
const scale = options.scale ?? DEFAULT_RENDER_SCALE;
|
|
104
116
|
const diffThreshold = options.diffThreshold ?? DEFAULT_DIFF_THRESHOLD;
|
|
105
117
|
const viewport = page.getViewport({ scale });
|
|
@@ -118,7 +130,7 @@ export async function extractStampAppearancesForPage(page, pageTransform, annota
|
|
|
118
130
|
const baseContext = baseCanvas.getContext("2d", { willReadFrequently: true });
|
|
119
131
|
const annotatedContext = annotatedCanvas.getContext("2d", { willReadFrequently: true });
|
|
120
132
|
if (!baseContext || !annotatedContext) return appearances;
|
|
121
|
-
for (const annotation of
|
|
133
|
+
for (const annotation of targetAnnotations) {
|
|
122
134
|
try {
|
|
123
135
|
const id = annotation.id;
|
|
124
136
|
const bounds = stampRectToPixelBounds(
|
|
@@ -138,7 +150,8 @@ export async function extractStampAppearancesForPage(page, pageTransform, annota
|
|
|
138
150
|
bounds.height,
|
|
139
151
|
diffThreshold
|
|
140
152
|
);
|
|
141
|
-
const { data: maskedData } = applyMaskOrFallback(annotatedData.data, mask);
|
|
153
|
+
const { data: maskedData, usedMask } = applyMaskOrFallback(annotatedData.data, mask);
|
|
154
|
+
if (!usedMask && options.skipEmptyDiff) continue;
|
|
142
155
|
const outputCanvas = createCanvas(bounds.width, bounds.height);
|
|
143
156
|
if (!outputCanvas) continue;
|
|
144
157
|
const outputContext = outputCanvas.getContext("2d");
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Digitized data copyright (c) 2010 Google Corporation
|
|
2
|
+
with Reserved Font Arimo, Tinos and Cousine.
|
|
3
|
+
Copyright (c) 2012 Red Hat, Inc.
|
|
4
|
+
with Reserved Font Name Liberation.
|
|
5
|
+
|
|
6
|
+
This Font Software is licensed under the SIL Open Font License,
|
|
7
|
+
Version 1.1.
|
|
8
|
+
|
|
9
|
+
This license is copied below, and is also available with a FAQ at:
|
|
10
|
+
http://scripts.sil.org/OFL
|
|
11
|
+
|
|
12
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
13
|
+
|
|
14
|
+
PREAMBLE The goals of the Open Font License (OFL) are to stimulate
|
|
15
|
+
worldwide development of collaborative font projects, to support the font
|
|
16
|
+
creation efforts of academic and linguistic communities, and to provide
|
|
17
|
+
a free and open framework in which fonts may be shared and improved in
|
|
18
|
+
partnership with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves.
|
|
22
|
+
The fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply to
|
|
27
|
+
any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
DEFINITIONS
|
|
32
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
33
|
+
Holder(s) under this license and clearly marked as such.
|
|
34
|
+
This may include source files, build scripts and documentation.
|
|
35
|
+
|
|
36
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
37
|
+
copyright statement(s).
|
|
38
|
+
|
|
39
|
+
"Original Version" refers to the collection of Font Software components
|
|
40
|
+
as distributed by the Copyright Holder(s).
|
|
41
|
+
|
|
42
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
43
|
+
or substituting ? in part or in whole ?
|
|
44
|
+
any of the components of the Original Version, by changing formats or
|
|
45
|
+
by porting the Font Software to a new environment.
|
|
46
|
+
|
|
47
|
+
"Author" refers to any designer, engineer, programmer, technical writer
|
|
48
|
+
or other person who contributed to the Font Software.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
PERMISSION & CONDITIONS
|
|
52
|
+
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
54
|
+
copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
55
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
56
|
+
Software, subject to the following conditions:
|
|
57
|
+
|
|
58
|
+
1) Neither the Font Software nor any of its individual components,in
|
|
59
|
+
Original or Modified Versions, may be sold by itself.
|
|
60
|
+
|
|
61
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
62
|
+
redistributed and/or sold with any software, provided that each copy
|
|
63
|
+
contains the above copyright notice and this license. These can be
|
|
64
|
+
included either as stand-alone text files, human-readable headers or
|
|
65
|
+
in the appropriate machine-readable metadata fields within text or
|
|
66
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
67
|
+
|
|
68
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
69
|
+
Name(s) unless explicit written permission is granted by the
|
|
70
|
+
corresponding Copyright Holder. This restriction only applies to the
|
|
71
|
+
primary font name as presented to the users.
|
|
72
|
+
|
|
73
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
74
|
+
Software shall not be used to promote, endorse or advertise any
|
|
75
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
76
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
77
|
+
permission.
|
|
78
|
+
|
|
79
|
+
5) The Font Software, modified or unmodified, in part or in whole, must
|
|
80
|
+
be distributed entirely under this license, and must not be distributed
|
|
81
|
+
under any other license. The requirement for fonts to remain under
|
|
82
|
+
this license does not apply to any document created using the Font
|
|
83
|
+
Software.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
TERMINATION
|
|
88
|
+
This license becomes null and void if any of the above conditions are not met.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
DISCLAIMER
|
|
93
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
94
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
95
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
96
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
97
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
98
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
99
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
100
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
|
|
101
|
+
DEALINGS IN THE FONT SOFTWARE.
|
|
102
|
+
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.kviewer-text-layer{left:0;line-height:1;overflow:hidden;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.kviewer-text-layer--interactive{cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text}.KViewer_is_painting.KViewer_painting_type_12 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_12 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_13 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_13 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_5 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_5 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_6 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_6 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_7 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_7 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_8 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_8 .kviewer-annotation-layer *{cursor:crosshair!important}.KViewer_is_painting.KViewer_painting_type_4 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_4 .kviewer-annotation-layer *{cursor:text!important}.KViewer_is_painting.KViewer_painting_type_11 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_11 .kviewer-annotation-layer *{cursor:crosshair!important}.KViewer_selector_hover{cursor:pointer!important}.kviewer-form-layer{left:0;overflow:hidden;position:absolute;top:0}.kviewer-form-field{box-sizing:border-box;position:absolute}.kviewer-form-input{background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 14%,transparent);border:1px solid transparent;box-sizing:border-box;color:#000;display:block;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:500;height:100%;line-height:normal;margin:0;outline:none;padding:1px 2px;resize:none;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;vertical-align:top}.kviewer-form-input:hover{background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 22%,transparent);border-color:rgba(0,0,0,.2)}.kviewer-form-input:focus{background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 28%,transparent);border-color:var(--kvw-field-color,var(--color-primary,#3b82f6));outline:2px solid var(--kvw-field-color,var(--color-primary,#3b82f6))}.kviewer-form-
|
|
1
|
+
.kviewer-text-layer{left:0;line-height:1;overflow:hidden;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.kviewer-text-layer--interactive{cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text}.KViewer_is_painting.KViewer_painting_type_12 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_12 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_13 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_13 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_5 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_5 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_6 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_6 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_7 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_7 .kviewer-annotation-layer *,.KViewer_is_painting.KViewer_painting_type_8 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_8 .kviewer-annotation-layer *{cursor:crosshair!important}.KViewer_is_painting.KViewer_painting_type_4 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_4 .kviewer-annotation-layer *{cursor:text!important}.KViewer_is_painting.KViewer_painting_type_11 .kviewer-annotation-layer,.KViewer_is_painting.KViewer_painting_type_11 .kviewer-annotation-layer *{cursor:crosshair!important}.KViewer_selector_hover{cursor:pointer!important}.kviewer-form-layer{left:0;overflow:hidden;position:absolute;top:0}.kviewer-form-field{box-sizing:border-box;position:absolute}.kviewer-form-input{background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 14%,transparent);border:1px solid transparent;box-sizing:border-box;color:#000;display:block;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:500;height:100%;line-height:normal;margin:0;outline:none;padding:1px 2px;resize:none;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;vertical-align:top}.kviewer-form-input:hover{background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 22%,transparent);border-color:rgba(0,0,0,.2)}.kviewer-form-input:focus{background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 28%,transparent);border-color:var(--kvw-field-color,var(--color-primary,#3b82f6));outline:2px solid var(--kvw-field-color,var(--color-primary,#3b82f6))}.kviewer-form-uselect{align-items:center;background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 14%,transparent);border:1px solid transparent;border-radius:0;box-sizing:border-box;color:#000;cursor:pointer;display:flex;height:100%;line-height:1;padding:0 11px 0 2px;width:100%}.kviewer-form-uselect:hover{background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 22%,transparent);border-color:rgba(0,0,0,.2)}.kviewer-form-uselect:focus-visible{background-color:color-mix(in srgb,var(--kvw-field-color,#1677ff) 28%,transparent);outline:2px solid var(--kvw-field-color,var(--color-primary,#3b82f6));outline-offset:-2px}.kviewer-form-uselect:disabled{cursor:default}.kviewer-form-listbox{overflow-y:auto;padding:0}.kviewer-form-listbox option{padding:1px 3px}.kviewer-form-editable-combo{height:100%;position:relative;width:100%}.kviewer-form-editable-combo input{height:100%;width:100%}.kviewer-form-checkbox,.kviewer-form-radio{align-items:center;background:#fff;box-sizing:border-box;cursor:pointer;display:flex;height:100%;justify-content:center;width:100%}.kviewer-form-checkbox input,.kviewer-form-radio input{accent-color:var(--kvw-field-color,var(--color-primary,#3b82f6));cursor:pointer;height:80%;margin:0;max-height:18px;max-width:18px;width:80%}.kviewer-form-checkbox--detected{background:transparent}.kviewer-form-checkbox--circle{border-radius:50%}.kviewer-form-checkbox__icon{color:#1a1a1a;height:65%;width:65%}.kviewer-form-checkbox--circle .kviewer-form-checkbox__icon{height:50%;width:50%}.kviewer-form-radio input{accent-color:var(--kvw-field-color,var(--color-primary,#3b82f6));cursor:pointer;height:80%;margin:0;max-height:18px;max-width:18px;width:80%}.kviewer-form-button{align-items:center;background:#c8c8c8;border:1px solid rgba(0,0,0,.35);box-sizing:border-box;color:#000;cursor:pointer;display:flex;font-family:inherit;font-weight:700;height:100%;justify-content:center;line-height:1;padding:0 6px;text-align:center;width:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.kviewer-form-button:hover{background:#bdbdbd}.kviewer-form-button:active{background:#b0b0b0}.kviewer-form-signature{align-items:center;background:rgba(255,255,200,.15);border:1px dashed rgba(0,0,0,.2);cursor:pointer;display:flex;height:100%;justify-content:center;width:100%}.kviewer-form-signature:hover{background:color-mix(in srgb,var(--kvw-field-color,#3b82f6) 8%,transparent);border-color:var(--kvw-field-color,var(--color-primary,#3b82f6))}.kviewer-form-signature--filled{background:transparent;border-color:transparent;border-style:solid}.kviewer-form-signature__preview{max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.kviewer-form-signature__placeholder{color:rgba(0,0,0,.4);font-size:10px;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}
|