pdf_test_fixtures library

Constants

testCaCertPem → const String
Test-only CA for chain-validation tests - never use outside this repository. Self-signed, CN=Dart PDF Test CA, 20 years, sha256.
testChainSignerCertPem → const String
Test-only leaf signed by testCaCertPem (CN=Dart PDF Chain Signer).
testChainSignerKeyPem → const String
PKCS#8 private key for testChainSignerCertPem. Test-only material.
testSignerCertPem → const String
testSignerKeyPem → const String

Properties

pkixCaCert Uint8List
CA certificate (DER) that issued pkixLeafCert and pkixTsaCert.
no setter
pkixCrl Uint8List
CRL (DER) signed by the CA, not listing the leaf serial.
no setter
pkixLeafCert Uint8List
Leaf signer certificate (DER), serial 0x1111, issued by pkixCaCert.
no setter
pkixLeafKey Uint8List
PKCS#8 private key (DER) matching pkixLeafCert.
no setter
pkixOcspGood Uint8List
OCSP response (DER) reporting pkixLeafCert as good.
no setter
pkixTsaCert Uint8List
TSA certificate (DER), serial 0x3333, timeStamping EKU, issued by the CA.
no setter
pkixTsaKey Uint8List
PKCS#8 private key (DER) matching pkixTsaCert.
no setter

Functions

adobeRgb1998Icc() Uint8List
ascii(String s) Uint8List
buildAcroFormPdf() Uint8List
Builds a one-page PDF with an interactive AcroForm:
buildAnnotatedPdf() Uint8List
Builds a 3-page PDF whose first page carries interactive annotations:
buildAppearanceAnnotationsPdf() Uint8List
Builds a one-page PDF whose annotations carry appearance streams:
buildClassicPdf() Uint8List
Builds a minimal one-page PDF with a classic cross-reference table.
buildEmbeddedFontImagePdf() Uint8List
Embedded-font page with an inline RGB image behind the text and a solid vector rectangle painted after it. Exercises mixed image/Slug painter order: neither the image nor the later occluder may be lifted around text.
buildEmbeddedFontPdf() Uint8List
One-page PDF whose text uses an embedded TrueType font (see buildTestTrueTypeFont); the page shows "AB" at 24pt.
buildEncryptedPdf({int revision = 3, String userPassword = '', String ownerPassword = 'owner'}) Uint8List
Builds an encrypted one-page PDF ("Hello, world!" plus an /Info whose /Title is the encrypted string "Secret Title").
buildMultiPagePdf(int pageCount) Uint8List
Builds a pageCount-page PDF; page N shows the text "Page N".
buildNestedPageTreePdf() Uint8List
Builds a 3-page PDF with a nested page tree exercising attribute inheritance (§7.7.3.4):
buildOrphanedAcroFormPdf() Uint8List
Builds a form with the "orphaned AcroField" defect some producers emit (notably a macOS 26.5 / Quartz build that re-saves filled forms): the /AcroForm /Fields tree and the on-page widget annotations are two disconnected copies of the same form.
buildPositionedTashkilPdf() Uint8List
Builds a one-page Type3-font PDF matching Skia's positioned Arabic tashkil output: every zero-advance mark is a separate text-showing run immediately before its base glyph and is shifted over that glyph.
buildRtlTextPdf({List<String> lines = const ['اهلا وسهلا', 'كيف حالك']}) Uint8List
Builds a one-page Type3-font PDF whose RTL words are painted by separate text-showing operators.
buildTaggedPdf() Uint8List
Builds a minimal Tagged PDF: one page whose content is tagged with marked-content (BDC/EMC + /MCID) and a logical structure tree.
buildTestCffFont() Uint8List
Builds a minimal CFF (Type1C) font: glyph 0 = .notdef, glyph 1 = an 800x800 square at the origin, mapped to character code 65 ('A') with advance width 660 (via nominalWidthX 600 + leading operand 60).
buildTestJpeg() Uint8List
A real, decodable 8x8 solid-red JPEG (CoreGraphics, quality 1.0). Decodes to r=254, g=0, b=0 within codec tolerance.
buildTestTimeStampToken(Uint8List timeStampRequest, {RsaPrivateKey? key, List<Uint8List>? certificateChain, DateTime? genTime, BigInt? serialNumber}) Uint8List
Mints a TimeStampToken (the bare ContentInfo) for timeStampRequest - the DER TimeStampReq produced by buildTimeStampRequest. The token copies the request's MessageImprint and nonce, stamps it with genTime (default a fixed test instant), and signs it with key/certificateChain (defaulting to the test signer identity acting as the TSA).
buildTestTrueTypeFont({bool includeCmap = true, bool includePost = false}) Uint8List
Builds a minimal TrueType font, unitsPerEm 1000, three glyphs: 0 = .notdef (empty), 1 = 'A' (triangle, advance 600), 2 = 'B' (square, advance 1000). The cmap is a (3,1) format 4 table.
buildVariedHeightPdf(int pageCount) Uint8List
Builds a pageCount-page PDF whose page heights cycle 792, 396, 1008 pt (all 612 wide); page N shows the text "Page N" near its top. Mixed sizes defeat any uniform-extent estimate, exercising viewers that must place far-away pages exactly (search jumps, links).
buildXrefStreamPdf() Uint8List
Builds a PDF in the "modern" 1.5+ layout: an uncompressed cross-reference stream, with the catalog and page tree packed into an object stream.
displayP3Icc() Uint8List
genericCmykIcc() Uint8List
genericGrayIcc() Uint8List