# Vendored engine-runtime corpus fixtures Most files in this directory are authored in-repo for specific suites. Thirteen are copies from the engine-runtime fork's test corpus, vendored so the conformance suites (`forms`, `actions`, `page-flatten`, `redaction-apply`, `text-divergence` — both the local-engine versions here and the cloud-parity versions in `cloudpdf/engine/test/`) run without the `packages/engine/runtime/runtime-src` submodule (a ~6.4 GB checkout that CI and most contributors never initialise). This directory is the single canonical copy — don't duplicate it per package: - `toggle_fields.pdf` - `orphan_widgets.pdf` - `listbox_form.pdf` - `document_aactions.pdf` - `get_page_aaction.pdf` - `annots_action_handling.pdf` - `annot_javascript.pdf` - `flatten_selective.pdf` - `hello_world.pdf` - `bug_1139.pdf` - `bug_384770169.pdf` - `embedpdf_astral_tounicode.pdf` - `bug_781804.pdf` Source of truth: `testing/resources/` in (the PDFium fork; upstream PDFium fixtures are BSD-3-Clause, see the fork's LICENSE). Copied from submodule commit `608d50ef5719bb179e8c0a8377b3759bcb39f169`; the three text-divergence fixtures were synced from runtime artifact commit `fce2b000cc7a9e2cabc92db41cd57ca03233f07d`, and `bug_781804.pdf` from submodule commit `2c1490a9e821826c79a69d475292a9b280639335`. When bumping the submodule, re-sync if the fork changed these files: ```bash cd packages/engine/runtime/runtime-src/testing/resources && cp \ toggle_fields.pdf orphan_widgets.pdf listbox_form.pdf \ document_aactions.pdf get_page_aaction.pdf annots_action_handling.pdf \ annot_javascript.pdf flatten_selective.pdf hello_world.pdf \ bug_1139.pdf bug_384770169.pdf embedpdf_astral_tounicode.pdf bug_781804.pdf \ ../../../../main/test/fixtures/ ``` If the vendored list keeps growing, replace the manual copy with a sync script instead of adding more entries here. ## A word split by a line-end hyphen `search_cross_run_bug.pdf` was contributed by Gianluca Guarini with GitHub issue #848 and pull request #849: a one-page PDF whose word "containers" is set as "con-" and "tainers" on two lines, which PDFium joins into one word with U+FFFE for the hyphen. `search-joined-hyphen.test.ts` searches it. ## Form fixtures for page insert and extract `page-form-fields.test.ts` uses two more copies: - `form_page_import.pdf`: the runtime fork's `testing/resources/form_page_import.pdf` (generated from its `.in` template), a two-page form whose fields sit on both pages. - `embedpdf-forms.pdf`: `website/public/pdfs/embedpdf-forms.pdf`, the docs' form demo, whose fields have kids. Merging it into a blank PDF is what the website's merge tool does. ## Generated action-payload fixtures `action_payloads.pdf` and `open_action_dest.pdf` are authored in-repo by a committed deterministic generator (no dates, no randomness — byte-stable output, so diffs are reviewable): ```bash node packages/engine/main/test/fixtures/generate-action-fixtures.mjs ``` `action_payloads.pdf` is one page of `/NM`-keyed link annotations carrying every executable action-payload shape: GoTo `/FitR`, URI + `/IsMap`, Named, Hide (an array mixing a field-name string with an indirect annotation reference plus `/H false`; a scalar `/T`; and a partial list poisoned by a direct inline dictionary), the ResetForm three states (`/Fields` absent / empty / non-empty with `/Flags 1`), Launch, GoToR, one JavaScript → GoTo → Hide `/Next` chain, and one malformed GoTo (no `/D`). `open_action_dest.pdf` carries a destination-form catalog `/OpenAction`. Both are single-page with a correct `/Count` so the cloud suite needs no byte patching. Edit the generator, re-run it, and commit both the script and the regenerated PDFs together. ## Generated search fixture `letter_spaced_text.pdf` backs `search-ignore-whitespace.test.ts` and is authored the same way (deterministic, byte-stable): ```bash node packages/engine/main/test/fixtures/generate-letter-spaced-fixture.mjs ``` Two pages of standard Helvetica (no embedded fonts) carrying the text shapes the `ignoreWhitespace` search flag exists for: a letter-spaced `i n v o i c e` on each page, a tracked-out `INVOICE` heading (character spacing), a mixed-case `I n v o i c e`, a plain `Invoice 42`, the glued `totalamount` next to the spaced `total amount`, `in` / `voice` split across a line break, and `the invoices` as the whole-word trap. ## Stamp opacity fixtures `stamp-opacity-acrobat.pdf` was saved by Acrobat 26.2: a built-in "Not Approved" stamp and a custom image stamp, each set to about 30% opacity. Each appearance is Acrobat's opacity layer, `/R0 gs /MWFOForm Do`, where `/R0` repeats the stamp's `/CA`; under the image stamp's layer, a plain form draws a transparency group. `stamp-rewrapped-acrobat.pdf` is generated, deterministic and byte-stable: ```bash node packages/engine/main/test/fixtures/generate-stamp-rewrapped-fixture.mjs ``` It holds two stamps as EmbedPDF writes them, after Acrobat edited them, in the structure Acrobat's saves show: Acrobat keeps our wrapper as its artwork and puts its own forms around it. `rewrapped-a` is turned 30 degrees and set to 60%, under Acrobat's layer and four forms that only draw our wrapper; `rewrapped-b` is set to 100%, under one such form; `rewrapped-c` is our 35% layer with `/CA` dropped, as a tool that keeps the appearance would leave it. `stamp-roundtrip-acrobat-60.pdf` and `stamp-roundtrip-acrobat-100.pdf` are the real round trip: an "Approved" stamp placed in the viewer, turned and set to 40%, then set to 60% and to 100% in Acrobat 26.2. Acrobat replaced our opacity layer with its own and kept our wrapper, under a form that moves it by 0.0008 pt (its own arithmetic puts the turned box a fraction off the origin). ## Signed fixtures `signature_chain.pdf` is vendored from the runtime fork (`testing/resources/signature_chain.pdf`, built from `signature_chain.in` by `fixup_pdf_template.py`): three chained revisions and two signature values whose `/ByteRange` is well-formed but seals no revision — the "partial coverage" case. `signed_two_approvals.pdf`, `signed_certified.pdf` and `signed_fieldmdp.pdf` are synthetic, produced by the fork's `EPDFSignature*` embedder tests (`fpdfsdk/epdf_signature_embeddertest.cpp`) and sealed with a throwaway test signer certificate ("Common Name: EmbedPDF test signer", self-signed) through OpenSSL CMS. They carry no personal data and no real key material. `signed_two_approvals.pdf` is the layer flow end to end: a plain base signed on field `first`, a form fill of `note` in a layer, a second signature on `second` from that layer; `signed_certified.pdf` is a certification with permission 2 on field `cert`; `signed_fieldmdp.pdf` is an approval signature on `sig1` over PDFium's `text_form.pdf` whose FieldMDP includes `Text Box`. `unsigned_sigfield.pdf` (one merged signature field + widget `sig`, a text group `group.total`) and `signature_artwork.pdf` (one page of vector strokes, a stand-in for signature artwork) are generated by hand for the signature conformance suite; both are a few hundred bytes of plain PDF. `two_page_sigfield.pdf` is `unsigned_sigfield.pdf` with one blank second page (pikepdf `add_blank_page`): a page that carries no `/Annots` in the base, for the "annotation added on a persisted layer, removed after a reopen" case. `jpx_resolution_levels.pdf` is synthetic: one 300 × 300 pt page drawing a 1600 × 1600 JPEG 2000 image with six resolution levels, and two square annotations whose appearances draw the same image. PDFium decodes such an image at a resolution that depends on the size of the render, and caches the decode on the page, so it shows whether a page reused across renders still renders exactly as a freshly loaded one. Generated with Pillow (OpenJPEG) and pikepdf: a smooth three-channel sine pattern, `irreversible=True`, `num_resolutions=6`, `quality_layers=[60]`, the page content `q 300 0 0 300 0 0 cm /Im0 Do Q`, and annotations at `[20 20 140 140]` and `[160 160 280 280]` with 120 × 120 appearance forms.