@embedpdf/engine-core 3.0.0-next.15 → 3.0.0-next.16
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/dist/{AnnotationList-CkijRHet.d.cts → AnnotationList-DcyhF2kU.d.cts} +1836 -1308
- package/dist/{AnnotationList-CkijRHet.d.ts → AnnotationList-DcyhF2kU.d.ts} +1836 -1308
- package/dist/{Change-CjImsrN0.cjs → Change-Ct-dB8D5.cjs} +115 -2
- package/dist/Change-Ct-dB8D5.cjs.map +1 -0
- package/dist/{Change-CKoxfTNY.js → Change-tMR34hTU.js} +92 -3
- package/dist/Change-tMR34hTU.js.map +1 -0
- package/dist/{DocumentRenderService-BfFdFSwI.cjs → DocumentRenderService-9IjSQEIU.cjs} +2 -1
- package/dist/{DocumentRenderService-BfFdFSwI.cjs.map → DocumentRenderService-9IjSQEIU.cjs.map} +1 -1
- package/dist/{DocumentRenderService-DV3J9lMz.js → DocumentRenderService-DFrZ9wfW.js} +2 -1
- package/dist/{DocumentRenderService-DV3J9lMz.js.map → DocumentRenderService-DFrZ9wfW.js.map} +1 -1
- package/dist/{DocumentSecurityService-e6vp2de8.d.cts → DocumentSecurityService-D2zA4NKi.d.cts} +2 -2
- package/dist/{DocumentSecurityService-CU1M6Q7m.d.ts → DocumentSecurityService-YJV9df8P.d.ts} +2 -2
- package/dist/{LocalEngine-DFoBm4B3.d.cts → LocalEngine-DBt2-GWF.d.ts} +102 -18
- package/dist/{LocalEngine-DPriFujS.d.ts → LocalEngine-IA9zh3Jh.d.cts} +102 -18
- package/dist/{authority-DLMNR7ff.cjs → authority-BFp6XM04.cjs} +373 -52
- package/dist/authority-BFp6XM04.cjs.map +1 -0
- package/dist/{authority-B3BklsB4.js → authority-PuxpGFhJ.js} +320 -53
- package/dist/authority-PuxpGFhJ.js.map +1 -0
- package/dist/{builders-CNj0POeY.js → builders-DV62HA3I.js} +6 -2
- package/dist/builders-DV62HA3I.js.map +1 -0
- package/dist/{builders-Cgdp_YCn.cjs → builders-DgTAj_tP.cjs} +6 -2
- package/dist/builders-DgTAj_tP.cjs.map +1 -0
- package/dist/{calibrate-DJBXnhLE.cjs → calibrate-DJbi1wuK.cjs} +118 -25
- package/dist/calibrate-DJbi1wuK.cjs.map +1 -0
- package/dist/{calibrate-7T3fnP8-.js → calibrate-nQFgCuki.js} +83 -26
- package/dist/calibrate-nQFgCuki.js.map +1 -0
- package/dist/charmap-Cprti1ta.js.map +1 -1
- package/dist/charmap-aYlefQP9.cjs.map +1 -1
- package/dist/conformance.cjs +1744 -75
- package/dist/conformance.cjs.map +1 -1
- package/dist/conformance.d.cts +105 -10
- package/dist/conformance.d.ts +105 -10
- package/dist/conformance.js +1738 -76
- package/dist/conformance.js.map +1 -1
- package/dist/index.cjs +25 -6
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/public.cjs +6 -4
- package/dist/public.d.cts +5 -5
- package/dist/public.d.ts +5 -5
- package/dist/public.js +5 -5
- package/dist/{resolver-CzxmD9Ck.js → resolver-BBggAxQc.js} +6 -3
- package/dist/resolver-BBggAxQc.js.map +1 -0
- package/dist/{resolver-D2OCtE8F.cjs → resolver-BWSWSF6R.cjs} +6 -3
- package/dist/resolver-BWSWSF6R.cjs.map +1 -0
- package/dist/{runtime-Cl0v56mm.d.ts → runtime-BaDKjxiu.d.ts} +67 -140
- package/dist/{runtime-p1WDzDo4.d.cts → runtime-CWEuiwbk.d.cts} +67 -140
- package/dist/runtime.cjs +267 -7
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +5 -5
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +246 -8
- package/dist/runtime.js.map +1 -1
- package/dist/{schema-DzlUNk38.js → schema-6S2VmlAj.js} +8 -2
- package/dist/schema-6S2VmlAj.js.map +1 -0
- package/dist/{schema-C-gU4vj7.cjs → schema-miH6tWQC.cjs} +13 -1
- package/dist/schema-miH6tWQC.cjs.map +1 -0
- package/dist/{schemas-D6xOGjqg.js → schemas-BE2QGOit.js} +256 -59
- package/dist/schemas-BE2QGOit.js.map +1 -0
- package/dist/{schemas-Berf1swF.cjs → schemas-DljJR9ut.cjs} +397 -80
- package/dist/schemas-DljJR9ut.cjs.map +1 -0
- package/dist/validation.cjs +1 -1
- package/dist/validation.d.cts +1 -1
- package/dist/validation.d.ts +1 -1
- package/dist/validation.js +1 -1
- package/dist/{viewport-DlL5Bxbg.cjs → viewport-CHG9qQUb.cjs} +2 -2
- package/dist/{viewport-DlL5Bxbg.cjs.map → viewport-CHG9qQUb.cjs.map} +1 -1
- package/dist/{viewport-BJW13EGZ.js → viewport-DQR5LyX3.js} +2 -2
- package/dist/{viewport-BJW13EGZ.js.map → viewport-DQR5LyX3.js.map} +1 -1
- package/dist/wire.cjs +225 -57
- package/dist/wire.cjs.map +1 -1
- package/dist/wire.d.cts +3548 -1151
- package/dist/wire.d.ts +3548 -1151
- package/dist/wire.js +198 -53
- package/dist/wire.js.map +1 -1
- package/package.json +1 -1
- package/dist/Change-CKoxfTNY.js.map +0 -1
- package/dist/Change-CjImsrN0.cjs.map +0 -1
- package/dist/authority-B3BklsB4.js.map +0 -1
- package/dist/authority-DLMNR7ff.cjs.map +0 -1
- package/dist/builders-CNj0POeY.js.map +0 -1
- package/dist/builders-Cgdp_YCn.cjs.map +0 -1
- package/dist/calibrate-7T3fnP8-.js.map +0 -1
- package/dist/calibrate-DJBXnhLE.cjs.map +0 -1
- package/dist/resolver-CzxmD9Ck.js.map +0 -1
- package/dist/resolver-D2OCtE8F.cjs.map +0 -1
- package/dist/schema-C-gU4vj7.cjs.map +0 -1
- package/dist/schema-DzlUNk38.js.map +0 -1
- package/dist/schemas-Berf1swF.cjs.map +0 -1
- package/dist/schemas-D6xOGjqg.js.map +0 -1
package/dist/conformance.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as Engine, t as LocalEngine, y as DocumentHandle } from "./LocalEngine-
|
|
1
|
+
import { F_ as PdfRect, Fs as AnnotationDraft, I_ as PdfRotation, Vd as AnnotationResources, _t as LineDraft, b_ as PageBox, dn as HighlightDraft, gh as PageTabOrder, iy as DocumentMetadata, nt as InkDraft, pv as Identity, t as AnnotationList, x_ as PagePoint, zp as CharMapAnchor } from "./AnnotationList-DcyhF2kU.cjs";
|
|
2
|
+
import { _ as Engine, t as LocalEngine, y as DocumentHandle } from "./LocalEngine-IA9zh3Jh.cjs";
|
|
3
3
|
//#region src/conformance/runMetadataConformance.d.ts
|
|
4
4
|
interface ConformanceTestRunner {
|
|
5
5
|
describe(name: string, fn: () => void): void;
|
|
@@ -564,6 +564,59 @@ interface PageRenderConformanceOptions {
|
|
|
564
564
|
*/
|
|
565
565
|
declare function runPageRenderConformance(runner: ConformanceTestRunner, opts: PageRenderConformanceOptions): void;
|
|
566
566
|
//#endregion
|
|
567
|
+
//#region src/conformance/runPrintRenderConformance.d.ts
|
|
568
|
+
/**
|
|
569
|
+
* A 200 × 200 page with one black 40 × 40 square for each print rule, and an
|
|
570
|
+
* A0 page (2384 × 3370) with nothing on it:
|
|
571
|
+
*
|
|
572
|
+
* - a layer that only prints, and one only shown on screen (`/Usage`
|
|
573
|
+
* `/PrintState` and `/ViewState`, as Acrobat's watermarks write them);
|
|
574
|
+
* - four squares: one that only prints (`noView` + `print`), one only on
|
|
575
|
+
* screen (no `print`), one on both (`print`), one on neither (`hidden`);
|
|
576
|
+
* - two form fields: a push button only on screen (Acrobat's "Visible but
|
|
577
|
+
* doesn't print") and a text field that only prints ("Hidden but
|
|
578
|
+
* printable").
|
|
579
|
+
*/
|
|
580
|
+
declare const PRINT_RULES_PDF: Uint8Array<ArrayBufferLike>;
|
|
581
|
+
/** The rights each case opens with: everything, no print, print but not high. */
|
|
582
|
+
declare const PRINT_SCOPES: {
|
|
583
|
+
readonly everything: readonly ["*"];
|
|
584
|
+
readonly screen: readonly ["doc.open", "doc.render", "doc.annotate.read", "doc.forms.read"];
|
|
585
|
+
readonly print: readonly ["doc.open", "doc.render", "doc.annotate.read", "doc.forms.read", "doc.print"];
|
|
586
|
+
};
|
|
587
|
+
interface PrintRenderConformanceOptions {
|
|
588
|
+
label: string;
|
|
589
|
+
/** Build a fresh engine for this suite. The suite tears it down at the end. */
|
|
590
|
+
makeEngine: () => Promise<Engine> | Engine;
|
|
591
|
+
/** Open a fresh copy of {@link PRINT_RULES_PDF} with `scope`. */
|
|
592
|
+
open: (engine: Engine, scope: readonly string[]) => Promise<DocumentHandle>;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Print pictures on both engines (`usage: 'print'` with a `dpi` viewport).
|
|
596
|
+
* A print picture follows
|
|
597
|
+
* the print rules where a screen picture follows the screen's: layers by
|
|
598
|
+
* their print state, annotations and form fields by their `print` flag,
|
|
599
|
+
* `noView` ones included, `hidden` ones never. It is the whole page at its
|
|
600
|
+
* DPI, never more pixels than the page fitted to A4 or Letter needs, and its
|
|
601
|
+
* transform is `pageTransform`'s. It needs `doc.print`, and 300 DPI
|
|
602
|
+
* `doc.print.high`; options that don't fit a print picture are refused.
|
|
603
|
+
*/
|
|
604
|
+
declare function runPrintRenderConformance(runner: ConformanceTestRunner, opts: PrintRenderConformanceOptions): void;
|
|
605
|
+
/**
|
|
606
|
+
* The print copy on both engines: `pages.extract(pages, { flatten })` makes
|
|
607
|
+
* the pages as they draw for `flatten.usage`, so a print copy, printed, shows
|
|
608
|
+
* what a print picture of the page shows (layers by their print state,
|
|
609
|
+
* annotations and fields by their `print` flag), with nothing interactive
|
|
610
|
+
* left. `includeAnnotations` and `includeFormFields` choose what it paints,
|
|
611
|
+
* with a page picture's defaults; they take `flatten`. A flattened copy needs
|
|
612
|
+
* `doc.download` or `doc.download.flattened`, a plain one `doc.download`.
|
|
613
|
+
*/
|
|
614
|
+
interface PrintCopyConformanceOptions extends PrintRenderConformanceOptions {
|
|
615
|
+
/** Open `bytes`, a copy the engine made, with every right. */
|
|
616
|
+
openCopy: (engine: Engine, bytes: Uint8Array) => Promise<DocumentHandle>;
|
|
617
|
+
}
|
|
618
|
+
declare function runPrintCopyConformance(runner: ConformanceTestRunner, opts: PrintCopyConformanceOptions): void;
|
|
619
|
+
//#endregion
|
|
567
620
|
//#region src/conformance/pageSpaceFixtures.d.ts
|
|
568
621
|
/**
|
|
569
622
|
* Small PDFs whose page boxes are odd in every way ISO 32000 allows, and in
|
|
@@ -859,17 +912,17 @@ declare function runPageExtractConformance(runner: ConformanceTestRunner, opts:
|
|
|
859
912
|
* Attachment conformance suite. Fixture requirement: a document whose
|
|
860
913
|
* `/EmbeddedFiles` name tree contains at least one embedded file.
|
|
861
914
|
*
|
|
862
|
-
* Both
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
*
|
|
915
|
+
* Both homes of a file: `doc.attachments` (the `/EmbeddedFiles` name tree)
|
|
916
|
+
* and a file-attachment annotation's `file` resource
|
|
917
|
+
* (`page.annotations.downloadResource(ref, 'file')`). Both downloads answer
|
|
918
|
+
* the bytes; the name and type are what the listing says.
|
|
866
919
|
*
|
|
867
920
|
* Invariants:
|
|
868
921
|
* 1. `list()` reflects the name tree: positional indices, non-empty
|
|
869
922
|
* names, and repeated calls agree (a read).
|
|
870
|
-
* 2. `download(
|
|
871
|
-
*
|
|
872
|
-
* 3. Unknown
|
|
923
|
+
* 2. `download(ref)` returns exactly `size` decoded bytes when the
|
|
924
|
+
* fixture declares one.
|
|
925
|
+
* 3. Unknown keys reject with an `EngineError`.
|
|
873
926
|
* 4. A created file-attachment annotation round-trips its file:
|
|
874
927
|
* metadata inline on the DTO (never bytes), bytes byte-identical
|
|
875
928
|
* as its `file` resource.
|
|
@@ -968,6 +1021,48 @@ declare function runChangeConformance(runner: ConformanceTestRunner, opts: Chang
|
|
|
968
1021
|
/** A PDF file of `objects`, numbered from 1, with its cross-reference table. */
|
|
969
1022
|
declare function pdfOf(objects: readonly string[]): Uint8Array;
|
|
970
1023
|
//#endregion
|
|
1024
|
+
//#region src/conformance/runOutlineConformance.d.ts
|
|
1025
|
+
/**
|
|
1026
|
+
* Two pages of 300 × 300 and an outline, five items showing when it opens:
|
|
1027
|
+
*
|
|
1028
|
+
* - A (6), open: to page 3 at (20, 280) in the file; its child A1 (10) fits page 4.
|
|
1029
|
+
* - B (7): red and bold, a URI action.
|
|
1030
|
+
* - C (8), closed: the named destination `chapter-two` (page 4, `/FitH` 250);
|
|
1031
|
+
* its child C1 (11) goes nowhere.
|
|
1032
|
+
* - D (9): a JavaScript action.
|
|
1033
|
+
*/
|
|
1034
|
+
declare const OUTLINE_FIXTURE_PDF: Uint8Array<ArrayBufferLike>;
|
|
1035
|
+
/**
|
|
1036
|
+
* An outline a write never made: One (4) and Two (5), whose `/Next` comes
|
|
1037
|
+
* back to One, and after One a direct item no one can name.
|
|
1038
|
+
*/
|
|
1039
|
+
declare const BROKEN_OUTLINE_FIXTURE_PDF: Uint8Array<ArrayBufferLike>;
|
|
1040
|
+
interface OutlineConformanceOptions {
|
|
1041
|
+
label: string;
|
|
1042
|
+
makeEngine: () => Promise<Engine> | Engine;
|
|
1043
|
+
/** Open `bytes`, one of the fixtures here, fresh for each call, with write access. */
|
|
1044
|
+
open: (engine: Engine, bytes: Uint8Array) => Promise<DocumentHandle>;
|
|
1045
|
+
/** Open `bytes` with the rights to open and read it only (`doc.open`, `doc.render`). */
|
|
1046
|
+
openReadOnly: (engine: Engine, bytes: Uint8Array) => Promise<DocumentHandle>;
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* The document's outline (`doc.outline`), the same on every engine:
|
|
1050
|
+
*
|
|
1051
|
+
* - A read lists every item depth first, with its parent, its target read the
|
|
1052
|
+
* way a link's is (in page space, a named destination resolved), its `/A`
|
|
1053
|
+
* tree, its colour and style, and whether it opens.
|
|
1054
|
+
* - Writes name items by object number and places by neighbour; moves keep
|
|
1055
|
+
* subtrees and numbers; deletes take the items under an item with it, and
|
|
1056
|
+
* an undo brings the same items back.
|
|
1057
|
+
* - Each write publishes its `outline.*` event; without `doc.outline.modify`
|
|
1058
|
+
* every write is refused and reading still works.
|
|
1059
|
+
* - A target reads the same however the file stores it: written into the
|
|
1060
|
+
* item or shared, named in the `/Names` tree or the old `/Dests`, a page
|
|
1061
|
+
* by index. A new target or an undo never changes an action an item shares.
|
|
1062
|
+
* - A broken outline reads what it can and says `incomplete`.
|
|
1063
|
+
*/
|
|
1064
|
+
declare function runOutlineConformance(runner: ConformanceTestRunner, opts: OutlineConformanceOptions): void;
|
|
1065
|
+
//#endregion
|
|
971
1066
|
//#region src/conformance/runPermissionConformance.d.ts
|
|
972
1067
|
/**
|
|
973
1068
|
* The two read families, through three tokens: one that may do everything,
|
|
@@ -1527,5 +1622,5 @@ interface FieldGroupsConformanceOptions {
|
|
|
1527
1622
|
}
|
|
1528
1623
|
declare function runFieldGroupsConformance(runner: ConformanceTestRunner, opts: FieldGroupsConformanceOptions): void;
|
|
1529
1624
|
//#endregion
|
|
1530
|
-
export { APPEARANCE_STATES_FIXTURE_PDF, type ActionsConformanceFixtures, type ActionsConformanceOptions, type AnnotationAppearanceConformanceFixture, type AnnotationAppearanceConformanceOptions, type AnnotationAttributionConformanceOptions, type AnnotationConformanceOptions, type AnnotationDeclarationConformanceOptions, type AnnotationDeclarationFixture, type AnnotationMutationConformanceFixture, type AnnotationMutationConformanceOptions, type AnnotationPredictionConformanceOptions, type AnnotationReadConformanceFixture, type AnnotationResourceConformanceOptions, type AnnotationResourceFixture, type AnnotationRotationConformanceOptions, type AnnotationRotationFixture, type AnnotationTransferConformanceOptions, type AppearanceStatesConformanceOptions, type AttributionSession, BARE_PAGE_FIXTURE_PDF, CHANGE_FIXTURE_PDF, COLOR_FIXTURE_PDF, CROP_OFFSET_PDF, type ChangeConformanceOptions, type ColorConformanceOptions, type ConformanceExpect, type ConformanceFixture, type ConformanceOptions, type ConformanceTestRunner, type Creatable, DRAWING_FIXTURE_PDF, type DateConformanceOptions, type DrawingDetailsConformanceOptions, type DrawingDetailsFixture, FIELD_GROUPS_PDF, FIELD_GROUP_TOKENS, type FieldGroupToken, type FieldGroupsConformanceOptions, type FormAttributionConformanceOptions, type FormConformanceFixtures, type FormConformanceOptions, type FormPredictionConformanceOptions, type FormScriptConformanceOptions, type FormTransferConformanceOptions, OBJECT_NUMBER_FIXTURE_PDF, type ObjectNumberConformanceOptions, PAGE_SPACE_FIXTURES, PERMISSION_TOKENS, PREDICTION_FIXTURE_PDF, type PageGeometryOrientationFixture, type PageGeometryOrientationOptions, type PageRenderConformanceOptions, type PageReorderConformanceFixture, type PageReorderConformanceOptions, type PageSpaceConformanceOptions, type PageSpaceFixture, type PageSpaceFixturePage, type PageTextConformanceFixture, type PageTextConformanceOptions, type PermissionConformanceOptions, type PermissionToken, type PieceInfoConformanceOptions, type RedactionApplyConformanceOptions, type SearchConformanceFixture, type SearchConformanceOptions, type SignatureConformanceFixtures, type SignatureConformanceOptions, TEXT_DIVERGENCE_CASES, TURNED_FIELDS_PDF, TWO_PAGES_PDF, type TextDivergenceCase, type TextDivergenceConformanceFixture, type TextDivergenceConformanceOptions, WIDGET_FINDING_CASES, type WidgetFindingCase, type WidgetFindingCaseName, type WidgetFindingConformanceOptions, type WidgetRotationConformanceOptions, annotationReadDriftOf, creatables, diffAnnotationList, iconRect, pdfOf, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationAppearanceExportConformance, runAnnotationAttributionConformance, runAnnotationDeclarationConformance, runAnnotationExportConformance, runAnnotationFlattenConformance, runAnnotationImportConformance, runAnnotationMutationConformance, runAnnotationPredictionConformance, runAnnotationReadConformance, runAnnotationResourceConformance, runAnnotationRotationConformance, runAnnotationTransferConformance, runAppearanceStatesConformance, runAttachmentConformance, runChangeConformance, runColorConformance, runDateConformance, runDocumentEventsConformance, runDrawingDetailsConformance, runFieldGroupsConformance, runFormAttributionConformance, runFormConformance, runFormPredictionConformance, runFormScriptConformance, runFormTransferConformance, runMeasurementConformance, runMetadataConformance, runNamedPagesConformance, runObjectNumberConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageGeometryOrientationConformance, runPageInsertBlankConformance, runPageInsertConformance, runPageRenderConformance, runPageReorderConformance, runPageRotateConformance, runPageSpaceConformance, runPageTextConformance, runPermissionConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance, runSignatureConformance, runTextDivergenceConformance, runWidgetFindingConformance, runWidgetRotationConformance };
|
|
1625
|
+
export { APPEARANCE_STATES_FIXTURE_PDF, type ActionsConformanceFixtures, type ActionsConformanceOptions, type AnnotationAppearanceConformanceFixture, type AnnotationAppearanceConformanceOptions, type AnnotationAttributionConformanceOptions, type AnnotationConformanceOptions, type AnnotationDeclarationConformanceOptions, type AnnotationDeclarationFixture, type AnnotationMutationConformanceFixture, type AnnotationMutationConformanceOptions, type AnnotationPredictionConformanceOptions, type AnnotationReadConformanceFixture, type AnnotationResourceConformanceOptions, type AnnotationResourceFixture, type AnnotationRotationConformanceOptions, type AnnotationRotationFixture, type AnnotationTransferConformanceOptions, type AppearanceStatesConformanceOptions, type AttributionSession, BARE_PAGE_FIXTURE_PDF, BROKEN_OUTLINE_FIXTURE_PDF, CHANGE_FIXTURE_PDF, COLOR_FIXTURE_PDF, CROP_OFFSET_PDF, type ChangeConformanceOptions, type ColorConformanceOptions, type ConformanceExpect, type ConformanceFixture, type ConformanceOptions, type ConformanceTestRunner, type Creatable, DRAWING_FIXTURE_PDF, type DateConformanceOptions, type DrawingDetailsConformanceOptions, type DrawingDetailsFixture, FIELD_GROUPS_PDF, FIELD_GROUP_TOKENS, type FieldGroupToken, type FieldGroupsConformanceOptions, type FormAttributionConformanceOptions, type FormConformanceFixtures, type FormConformanceOptions, type FormPredictionConformanceOptions, type FormScriptConformanceOptions, type FormTransferConformanceOptions, OBJECT_NUMBER_FIXTURE_PDF, OUTLINE_FIXTURE_PDF, type ObjectNumberConformanceOptions, type OutlineConformanceOptions, PAGE_SPACE_FIXTURES, PERMISSION_TOKENS, PREDICTION_FIXTURE_PDF, PRINT_RULES_PDF, PRINT_SCOPES, type PageGeometryOrientationFixture, type PageGeometryOrientationOptions, type PageRenderConformanceOptions, type PageReorderConformanceFixture, type PageReorderConformanceOptions, type PageSpaceConformanceOptions, type PageSpaceFixture, type PageSpaceFixturePage, type PageTextConformanceFixture, type PageTextConformanceOptions, type PermissionConformanceOptions, type PermissionToken, type PieceInfoConformanceOptions, type PrintCopyConformanceOptions, type PrintRenderConformanceOptions, type RedactionApplyConformanceOptions, type SearchConformanceFixture, type SearchConformanceOptions, type SignatureConformanceFixtures, type SignatureConformanceOptions, TEXT_DIVERGENCE_CASES, TURNED_FIELDS_PDF, TWO_PAGES_PDF, type TextDivergenceCase, type TextDivergenceConformanceFixture, type TextDivergenceConformanceOptions, WIDGET_FINDING_CASES, type WidgetFindingCase, type WidgetFindingCaseName, type WidgetFindingConformanceOptions, type WidgetRotationConformanceOptions, annotationReadDriftOf, creatables, diffAnnotationList, iconRect, pdfOf, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationAppearanceExportConformance, runAnnotationAttributionConformance, runAnnotationDeclarationConformance, runAnnotationExportConformance, runAnnotationFlattenConformance, runAnnotationImportConformance, runAnnotationMutationConformance, runAnnotationPredictionConformance, runAnnotationReadConformance, runAnnotationResourceConformance, runAnnotationRotationConformance, runAnnotationTransferConformance, runAppearanceStatesConformance, runAttachmentConformance, runChangeConformance, runColorConformance, runDateConformance, runDocumentEventsConformance, runDrawingDetailsConformance, runFieldGroupsConformance, runFormAttributionConformance, runFormConformance, runFormPredictionConformance, runFormScriptConformance, runFormTransferConformance, runMeasurementConformance, runMetadataConformance, runNamedPagesConformance, runObjectNumberConformance, runOutlineConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageGeometryOrientationConformance, runPageInsertBlankConformance, runPageInsertConformance, runPageRenderConformance, runPageReorderConformance, runPageRotateConformance, runPageSpaceConformance, runPageTextConformance, runPermissionConformance, runPieceInfoConformance, runPrintCopyConformance, runPrintRenderConformance, runRedactionApplyConformance, runSearchConformance, runSignatureConformance, runTextDivergenceConformance, runWidgetFindingConformance, runWidgetRotationConformance };
|
|
1531
1626
|
//# sourceMappingURL=conformance.d.cts.map
|
package/dist/conformance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as Engine, t as LocalEngine, y as DocumentHandle } from "./LocalEngine-
|
|
1
|
+
import { F_ as PdfRect, Fs as AnnotationDraft, I_ as PdfRotation, Vd as AnnotationResources, _t as LineDraft, b_ as PageBox, dn as HighlightDraft, gh as PageTabOrder, iy as DocumentMetadata, nt as InkDraft, pv as Identity, t as AnnotationList, x_ as PagePoint, zp as CharMapAnchor } from "./AnnotationList-DcyhF2kU.js";
|
|
2
|
+
import { _ as Engine, t as LocalEngine, y as DocumentHandle } from "./LocalEngine-DBt2-GWF.js";
|
|
3
3
|
//#region src/conformance/runMetadataConformance.d.ts
|
|
4
4
|
interface ConformanceTestRunner {
|
|
5
5
|
describe(name: string, fn: () => void): void;
|
|
@@ -564,6 +564,59 @@ interface PageRenderConformanceOptions {
|
|
|
564
564
|
*/
|
|
565
565
|
declare function runPageRenderConformance(runner: ConformanceTestRunner, opts: PageRenderConformanceOptions): void;
|
|
566
566
|
//#endregion
|
|
567
|
+
//#region src/conformance/runPrintRenderConformance.d.ts
|
|
568
|
+
/**
|
|
569
|
+
* A 200 × 200 page with one black 40 × 40 square for each print rule, and an
|
|
570
|
+
* A0 page (2384 × 3370) with nothing on it:
|
|
571
|
+
*
|
|
572
|
+
* - a layer that only prints, and one only shown on screen (`/Usage`
|
|
573
|
+
* `/PrintState` and `/ViewState`, as Acrobat's watermarks write them);
|
|
574
|
+
* - four squares: one that only prints (`noView` + `print`), one only on
|
|
575
|
+
* screen (no `print`), one on both (`print`), one on neither (`hidden`);
|
|
576
|
+
* - two form fields: a push button only on screen (Acrobat's "Visible but
|
|
577
|
+
* doesn't print") and a text field that only prints ("Hidden but
|
|
578
|
+
* printable").
|
|
579
|
+
*/
|
|
580
|
+
declare const PRINT_RULES_PDF: Uint8Array<ArrayBufferLike>;
|
|
581
|
+
/** The rights each case opens with: everything, no print, print but not high. */
|
|
582
|
+
declare const PRINT_SCOPES: {
|
|
583
|
+
readonly everything: readonly ["*"];
|
|
584
|
+
readonly screen: readonly ["doc.open", "doc.render", "doc.annotate.read", "doc.forms.read"];
|
|
585
|
+
readonly print: readonly ["doc.open", "doc.render", "doc.annotate.read", "doc.forms.read", "doc.print"];
|
|
586
|
+
};
|
|
587
|
+
interface PrintRenderConformanceOptions {
|
|
588
|
+
label: string;
|
|
589
|
+
/** Build a fresh engine for this suite. The suite tears it down at the end. */
|
|
590
|
+
makeEngine: () => Promise<Engine> | Engine;
|
|
591
|
+
/** Open a fresh copy of {@link PRINT_RULES_PDF} with `scope`. */
|
|
592
|
+
open: (engine: Engine, scope: readonly string[]) => Promise<DocumentHandle>;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Print pictures on both engines (`usage: 'print'` with a `dpi` viewport).
|
|
596
|
+
* A print picture follows
|
|
597
|
+
* the print rules where a screen picture follows the screen's: layers by
|
|
598
|
+
* their print state, annotations and form fields by their `print` flag,
|
|
599
|
+
* `noView` ones included, `hidden` ones never. It is the whole page at its
|
|
600
|
+
* DPI, never more pixels than the page fitted to A4 or Letter needs, and its
|
|
601
|
+
* transform is `pageTransform`'s. It needs `doc.print`, and 300 DPI
|
|
602
|
+
* `doc.print.high`; options that don't fit a print picture are refused.
|
|
603
|
+
*/
|
|
604
|
+
declare function runPrintRenderConformance(runner: ConformanceTestRunner, opts: PrintRenderConformanceOptions): void;
|
|
605
|
+
/**
|
|
606
|
+
* The print copy on both engines: `pages.extract(pages, { flatten })` makes
|
|
607
|
+
* the pages as they draw for `flatten.usage`, so a print copy, printed, shows
|
|
608
|
+
* what a print picture of the page shows (layers by their print state,
|
|
609
|
+
* annotations and fields by their `print` flag), with nothing interactive
|
|
610
|
+
* left. `includeAnnotations` and `includeFormFields` choose what it paints,
|
|
611
|
+
* with a page picture's defaults; they take `flatten`. A flattened copy needs
|
|
612
|
+
* `doc.download` or `doc.download.flattened`, a plain one `doc.download`.
|
|
613
|
+
*/
|
|
614
|
+
interface PrintCopyConformanceOptions extends PrintRenderConformanceOptions {
|
|
615
|
+
/** Open `bytes`, a copy the engine made, with every right. */
|
|
616
|
+
openCopy: (engine: Engine, bytes: Uint8Array) => Promise<DocumentHandle>;
|
|
617
|
+
}
|
|
618
|
+
declare function runPrintCopyConformance(runner: ConformanceTestRunner, opts: PrintCopyConformanceOptions): void;
|
|
619
|
+
//#endregion
|
|
567
620
|
//#region src/conformance/pageSpaceFixtures.d.ts
|
|
568
621
|
/**
|
|
569
622
|
* Small PDFs whose page boxes are odd in every way ISO 32000 allows, and in
|
|
@@ -859,17 +912,17 @@ declare function runPageExtractConformance(runner: ConformanceTestRunner, opts:
|
|
|
859
912
|
* Attachment conformance suite. Fixture requirement: a document whose
|
|
860
913
|
* `/EmbeddedFiles` name tree contains at least one embedded file.
|
|
861
914
|
*
|
|
862
|
-
* Both
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
*
|
|
915
|
+
* Both homes of a file: `doc.attachments` (the `/EmbeddedFiles` name tree)
|
|
916
|
+
* and a file-attachment annotation's `file` resource
|
|
917
|
+
* (`page.annotations.downloadResource(ref, 'file')`). Both downloads answer
|
|
918
|
+
* the bytes; the name and type are what the listing says.
|
|
866
919
|
*
|
|
867
920
|
* Invariants:
|
|
868
921
|
* 1. `list()` reflects the name tree: positional indices, non-empty
|
|
869
922
|
* names, and repeated calls agree (a read).
|
|
870
|
-
* 2. `download(
|
|
871
|
-
*
|
|
872
|
-
* 3. Unknown
|
|
923
|
+
* 2. `download(ref)` returns exactly `size` decoded bytes when the
|
|
924
|
+
* fixture declares one.
|
|
925
|
+
* 3. Unknown keys reject with an `EngineError`.
|
|
873
926
|
* 4. A created file-attachment annotation round-trips its file:
|
|
874
927
|
* metadata inline on the DTO (never bytes), bytes byte-identical
|
|
875
928
|
* as its `file` resource.
|
|
@@ -968,6 +1021,48 @@ declare function runChangeConformance(runner: ConformanceTestRunner, opts: Chang
|
|
|
968
1021
|
/** A PDF file of `objects`, numbered from 1, with its cross-reference table. */
|
|
969
1022
|
declare function pdfOf(objects: readonly string[]): Uint8Array;
|
|
970
1023
|
//#endregion
|
|
1024
|
+
//#region src/conformance/runOutlineConformance.d.ts
|
|
1025
|
+
/**
|
|
1026
|
+
* Two pages of 300 × 300 and an outline, five items showing when it opens:
|
|
1027
|
+
*
|
|
1028
|
+
* - A (6), open: to page 3 at (20, 280) in the file; its child A1 (10) fits page 4.
|
|
1029
|
+
* - B (7): red and bold, a URI action.
|
|
1030
|
+
* - C (8), closed: the named destination `chapter-two` (page 4, `/FitH` 250);
|
|
1031
|
+
* its child C1 (11) goes nowhere.
|
|
1032
|
+
* - D (9): a JavaScript action.
|
|
1033
|
+
*/
|
|
1034
|
+
declare const OUTLINE_FIXTURE_PDF: Uint8Array<ArrayBufferLike>;
|
|
1035
|
+
/**
|
|
1036
|
+
* An outline a write never made: One (4) and Two (5), whose `/Next` comes
|
|
1037
|
+
* back to One, and after One a direct item no one can name.
|
|
1038
|
+
*/
|
|
1039
|
+
declare const BROKEN_OUTLINE_FIXTURE_PDF: Uint8Array<ArrayBufferLike>;
|
|
1040
|
+
interface OutlineConformanceOptions {
|
|
1041
|
+
label: string;
|
|
1042
|
+
makeEngine: () => Promise<Engine> | Engine;
|
|
1043
|
+
/** Open `bytes`, one of the fixtures here, fresh for each call, with write access. */
|
|
1044
|
+
open: (engine: Engine, bytes: Uint8Array) => Promise<DocumentHandle>;
|
|
1045
|
+
/** Open `bytes` with the rights to open and read it only (`doc.open`, `doc.render`). */
|
|
1046
|
+
openReadOnly: (engine: Engine, bytes: Uint8Array) => Promise<DocumentHandle>;
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* The document's outline (`doc.outline`), the same on every engine:
|
|
1050
|
+
*
|
|
1051
|
+
* - A read lists every item depth first, with its parent, its target read the
|
|
1052
|
+
* way a link's is (in page space, a named destination resolved), its `/A`
|
|
1053
|
+
* tree, its colour and style, and whether it opens.
|
|
1054
|
+
* - Writes name items by object number and places by neighbour; moves keep
|
|
1055
|
+
* subtrees and numbers; deletes take the items under an item with it, and
|
|
1056
|
+
* an undo brings the same items back.
|
|
1057
|
+
* - Each write publishes its `outline.*` event; without `doc.outline.modify`
|
|
1058
|
+
* every write is refused and reading still works.
|
|
1059
|
+
* - A target reads the same however the file stores it: written into the
|
|
1060
|
+
* item or shared, named in the `/Names` tree or the old `/Dests`, a page
|
|
1061
|
+
* by index. A new target or an undo never changes an action an item shares.
|
|
1062
|
+
* - A broken outline reads what it can and says `incomplete`.
|
|
1063
|
+
*/
|
|
1064
|
+
declare function runOutlineConformance(runner: ConformanceTestRunner, opts: OutlineConformanceOptions): void;
|
|
1065
|
+
//#endregion
|
|
971
1066
|
//#region src/conformance/runPermissionConformance.d.ts
|
|
972
1067
|
/**
|
|
973
1068
|
* The two read families, through three tokens: one that may do everything,
|
|
@@ -1527,5 +1622,5 @@ interface FieldGroupsConformanceOptions {
|
|
|
1527
1622
|
}
|
|
1528
1623
|
declare function runFieldGroupsConformance(runner: ConformanceTestRunner, opts: FieldGroupsConformanceOptions): void;
|
|
1529
1624
|
//#endregion
|
|
1530
|
-
export { APPEARANCE_STATES_FIXTURE_PDF, type ActionsConformanceFixtures, type ActionsConformanceOptions, type AnnotationAppearanceConformanceFixture, type AnnotationAppearanceConformanceOptions, type AnnotationAttributionConformanceOptions, type AnnotationConformanceOptions, type AnnotationDeclarationConformanceOptions, type AnnotationDeclarationFixture, type AnnotationMutationConformanceFixture, type AnnotationMutationConformanceOptions, type AnnotationPredictionConformanceOptions, type AnnotationReadConformanceFixture, type AnnotationResourceConformanceOptions, type AnnotationResourceFixture, type AnnotationRotationConformanceOptions, type AnnotationRotationFixture, type AnnotationTransferConformanceOptions, type AppearanceStatesConformanceOptions, type AttributionSession, BARE_PAGE_FIXTURE_PDF, CHANGE_FIXTURE_PDF, COLOR_FIXTURE_PDF, CROP_OFFSET_PDF, type ChangeConformanceOptions, type ColorConformanceOptions, type ConformanceExpect, type ConformanceFixture, type ConformanceOptions, type ConformanceTestRunner, type Creatable, DRAWING_FIXTURE_PDF, type DateConformanceOptions, type DrawingDetailsConformanceOptions, type DrawingDetailsFixture, FIELD_GROUPS_PDF, FIELD_GROUP_TOKENS, type FieldGroupToken, type FieldGroupsConformanceOptions, type FormAttributionConformanceOptions, type FormConformanceFixtures, type FormConformanceOptions, type FormPredictionConformanceOptions, type FormScriptConformanceOptions, type FormTransferConformanceOptions, OBJECT_NUMBER_FIXTURE_PDF, type ObjectNumberConformanceOptions, PAGE_SPACE_FIXTURES, PERMISSION_TOKENS, PREDICTION_FIXTURE_PDF, type PageGeometryOrientationFixture, type PageGeometryOrientationOptions, type PageRenderConformanceOptions, type PageReorderConformanceFixture, type PageReorderConformanceOptions, type PageSpaceConformanceOptions, type PageSpaceFixture, type PageSpaceFixturePage, type PageTextConformanceFixture, type PageTextConformanceOptions, type PermissionConformanceOptions, type PermissionToken, type PieceInfoConformanceOptions, type RedactionApplyConformanceOptions, type SearchConformanceFixture, type SearchConformanceOptions, type SignatureConformanceFixtures, type SignatureConformanceOptions, TEXT_DIVERGENCE_CASES, TURNED_FIELDS_PDF, TWO_PAGES_PDF, type TextDivergenceCase, type TextDivergenceConformanceFixture, type TextDivergenceConformanceOptions, WIDGET_FINDING_CASES, type WidgetFindingCase, type WidgetFindingCaseName, type WidgetFindingConformanceOptions, type WidgetRotationConformanceOptions, annotationReadDriftOf, creatables, diffAnnotationList, iconRect, pdfOf, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationAppearanceExportConformance, runAnnotationAttributionConformance, runAnnotationDeclarationConformance, runAnnotationExportConformance, runAnnotationFlattenConformance, runAnnotationImportConformance, runAnnotationMutationConformance, runAnnotationPredictionConformance, runAnnotationReadConformance, runAnnotationResourceConformance, runAnnotationRotationConformance, runAnnotationTransferConformance, runAppearanceStatesConformance, runAttachmentConformance, runChangeConformance, runColorConformance, runDateConformance, runDocumentEventsConformance, runDrawingDetailsConformance, runFieldGroupsConformance, runFormAttributionConformance, runFormConformance, runFormPredictionConformance, runFormScriptConformance, runFormTransferConformance, runMeasurementConformance, runMetadataConformance, runNamedPagesConformance, runObjectNumberConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageGeometryOrientationConformance, runPageInsertBlankConformance, runPageInsertConformance, runPageRenderConformance, runPageReorderConformance, runPageRotateConformance, runPageSpaceConformance, runPageTextConformance, runPermissionConformance, runPieceInfoConformance, runRedactionApplyConformance, runSearchConformance, runSignatureConformance, runTextDivergenceConformance, runWidgetFindingConformance, runWidgetRotationConformance };
|
|
1625
|
+
export { APPEARANCE_STATES_FIXTURE_PDF, type ActionsConformanceFixtures, type ActionsConformanceOptions, type AnnotationAppearanceConformanceFixture, type AnnotationAppearanceConformanceOptions, type AnnotationAttributionConformanceOptions, type AnnotationConformanceOptions, type AnnotationDeclarationConformanceOptions, type AnnotationDeclarationFixture, type AnnotationMutationConformanceFixture, type AnnotationMutationConformanceOptions, type AnnotationPredictionConformanceOptions, type AnnotationReadConformanceFixture, type AnnotationResourceConformanceOptions, type AnnotationResourceFixture, type AnnotationRotationConformanceOptions, type AnnotationRotationFixture, type AnnotationTransferConformanceOptions, type AppearanceStatesConformanceOptions, type AttributionSession, BARE_PAGE_FIXTURE_PDF, BROKEN_OUTLINE_FIXTURE_PDF, CHANGE_FIXTURE_PDF, COLOR_FIXTURE_PDF, CROP_OFFSET_PDF, type ChangeConformanceOptions, type ColorConformanceOptions, type ConformanceExpect, type ConformanceFixture, type ConformanceOptions, type ConformanceTestRunner, type Creatable, DRAWING_FIXTURE_PDF, type DateConformanceOptions, type DrawingDetailsConformanceOptions, type DrawingDetailsFixture, FIELD_GROUPS_PDF, FIELD_GROUP_TOKENS, type FieldGroupToken, type FieldGroupsConformanceOptions, type FormAttributionConformanceOptions, type FormConformanceFixtures, type FormConformanceOptions, type FormPredictionConformanceOptions, type FormScriptConformanceOptions, type FormTransferConformanceOptions, OBJECT_NUMBER_FIXTURE_PDF, OUTLINE_FIXTURE_PDF, type ObjectNumberConformanceOptions, type OutlineConformanceOptions, PAGE_SPACE_FIXTURES, PERMISSION_TOKENS, PREDICTION_FIXTURE_PDF, PRINT_RULES_PDF, PRINT_SCOPES, type PageGeometryOrientationFixture, type PageGeometryOrientationOptions, type PageRenderConformanceOptions, type PageReorderConformanceFixture, type PageReorderConformanceOptions, type PageSpaceConformanceOptions, type PageSpaceFixture, type PageSpaceFixturePage, type PageTextConformanceFixture, type PageTextConformanceOptions, type PermissionConformanceOptions, type PermissionToken, type PieceInfoConformanceOptions, type PrintCopyConformanceOptions, type PrintRenderConformanceOptions, type RedactionApplyConformanceOptions, type SearchConformanceFixture, type SearchConformanceOptions, type SignatureConformanceFixtures, type SignatureConformanceOptions, TEXT_DIVERGENCE_CASES, TURNED_FIELDS_PDF, TWO_PAGES_PDF, type TextDivergenceCase, type TextDivergenceConformanceFixture, type TextDivergenceConformanceOptions, WIDGET_FINDING_CASES, type WidgetFindingCase, type WidgetFindingCaseName, type WidgetFindingConformanceOptions, type WidgetRotationConformanceOptions, annotationReadDriftOf, creatables, diffAnnotationList, iconRect, pdfOf, runActionsConformance, runAnnotationAppearanceConformance, runAnnotationAppearanceExportConformance, runAnnotationAttributionConformance, runAnnotationDeclarationConformance, runAnnotationExportConformance, runAnnotationFlattenConformance, runAnnotationImportConformance, runAnnotationMutationConformance, runAnnotationPredictionConformance, runAnnotationReadConformance, runAnnotationResourceConformance, runAnnotationRotationConformance, runAnnotationTransferConformance, runAppearanceStatesConformance, runAttachmentConformance, runChangeConformance, runColorConformance, runDateConformance, runDocumentEventsConformance, runDrawingDetailsConformance, runFieldGroupsConformance, runFormAttributionConformance, runFormConformance, runFormPredictionConformance, runFormScriptConformance, runFormTransferConformance, runMeasurementConformance, runMetadataConformance, runNamedPagesConformance, runObjectNumberConformance, runOutlineConformance, runPageDeleteConformance, runPageExtractConformance, runPageFlattenConformance, runPageGeometryOrientationConformance, runPageInsertBlankConformance, runPageInsertConformance, runPageRenderConformance, runPageReorderConformance, runPageRotateConformance, runPageSpaceConformance, runPageTextConformance, runPermissionConformance, runPieceInfoConformance, runPrintCopyConformance, runPrintRenderConformance, runRedactionApplyConformance, runSearchConformance, runSignatureConformance, runTextDivergenceConformance, runWidgetFindingConformance, runWidgetRotationConformance };
|
|
1531
1626
|
//# sourceMappingURL=conformance.d.ts.map
|