/reamkit:pdf-compliancefrom reamkit
Configures Ream to produce archival PDF/A (1a-3u), accessible PDF/UA-1, digitally signed, encrypted, or bookmarked PDFs with metadata, attachments, and renderer parity.
Ships in reamkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Every option below goes to convert('pdf', options) or
convertWithReport('pdf', options) on a parsed document. The fonts used are
whatever the call resolves (see the supply-fonts skill); for a PDF that must
be reproducible offline, pass fonts or fontFetch.
import { Ream } from 'reamkit';
const doc = Ream.parse(bytes);
const { bytes: pdf, losses } = await doc.convertWithReport('pdf', { pdfA: 'PDF/A-2b' });
| Option | Combines with | Excludes |
|---|---|---|
pdfA | pdfUA (with an a level), signature, outline, info | encrypt (throws) |
pdfUA: true | pdfA a-levels, signature, encrypt | none |
encrypt | pdfUA, outline, info | pdfA and signature (both throw) |
signature | pdfA, pdfUA, outline, info | encrypt (throws) |
embedSource, attachments | plain PDF and PDF/A-3* | silently left out under PDF/A-1*, PDF/A-2* |
const pdfa = await doc.convert('pdf', { pdfA: 'PDF/A-2b' });
PDF/A-1a, PDF/A-1b): PDF 1.4, transparency flattened.2a, 2b, 2u): PDF 1.7, transparency kept. The usual choice.3a, 3b, 3u): part 2 plus embedded files.a adds the tagged logical structure (headings, tables, lists, figure
alt text), b is visual conformance, u is b with Unicode text mapping.const { bytes: pdfa } = await doc.convertWithReport('pdf', {
pdfA: 'PDF/A-3b',
embedSource: true, // the parsed .docx/.xlsx/… rides along as /AFRelationship /Source
attachments: [
{ name: 'data.csv', bytes: csvBytes, mimeType: 'text/csv', relationship: 'Data' },
],
});
relationship is one of 'Source' | 'Data' | 'Alternative' | 'Supplement' | 'Unspecified'.
const accessible = await doc.convert('pdf', {
pdfUA: true, // implies tagged; add pdfA: 'PDF/A-2a' for an archival copy in the same file
info: { title: 'Annual report 2026' }, // the title assistive technology announces
language: 'en-GB', // catalog /Lang; a .docx supplies its own w:lang, the default is en-US
});
tagged: true alone writes the structure tree without claiming PDF/UA.
A detached PKCS#7 signature over SHA-256, through WebCrypto, in an invisible
signature field. The key is a WebCrypto CryptoKey: RSASSA-PKCS1-v1_5 by
default, or ECDSA (P-256, P-384, P-521) with algorithm: 'ecdsa'.
declare const certificateDer: Uint8Array; // the signer's certificate, DER
declare const privateKeyPkcs8: Uint8Array<ArrayBuffer>; // its private key, PKCS#8 DER
const privateKey = await crypto.subtle.importKey(
'pkcs8',
privateKeyPkcs8,
{ name: 'RSASSA-PKCS1-v1_5', hash: 'SHA-256' },
false,
['sign'],
);
const signed = await doc.convert('pdf', {
signature: {
certificate: certificateDer,
privateKey,
extraCertificates: [], // intermediate CA certificates (DER) to embed
reason: 'Approved',
location: 'Head office',
signingTime: new Date(),
},
});
For an ECDSA key, import it with { name: 'ECDSA', namedCurve: 'P-256' } (or
P-384, P-521) and pass algorithm: 'ecdsa'.
Nothing may rewrite the bytes after signing: re-saving, linearizing,
compressing or stamping the file invalidates the signature. A long certificate
chain can outgrow the 8192 bytes reserved for the signature, which fails with
signPdf: signature (…) exceeds reserved /Contents (…); raise reserveBytes;
pass a larger reserveBytes in signature.
AES-256 (security handler revision 6), on the asynchronous path:
const locked = await doc.convert('pdf', {
encrypt: {
userPassword: 'open-me', // '' opens without a prompt but keeps the restrictions
ownerPassword: 'owner-secret', // defaults to the user password
permissions: { copying: false, modifying: false, printing: true },
},
});
Each permission defaults to allowed. Encrypted output is not byte-stable: the key, salts and IVs are random on every call.
const pdf = await doc.convert('pdf', {
outline: { maxLevel: 3, openPanel: true }, // headings 1–3, panel open; false for none
info: { title: 'Q4 Report', author: 'Finance', subject: 'Quarterly results' },
commentAnnotations: true, // Word comments also as sticky notes (not under PDF/A or tagged)
});
The outline is on by default, built from a document's headings, a workbook's
sheets or a deck's slides. info is read from the document's own properties
and the values you pass override them.
const pdf = await doc.convert('pdf', { layoutProfile: 'word' }); // or 'libreoffice'; default 'ream'
The profile changes how flowing text (Word and PowerPoint sources) is measured, broken and stacked; a workbook follows Excel's row model regardless. Combine it with the metric-compatible substitute fonts (the default) or the document's real fonts, or the line breaks still differ.
encrypt with pdfA or signatureISO 19005 forbids encryption in PDF/A, and Ream does not sign encrypted output.
Both combinations throw (PDF/A forbids encryption (ISO 19005),
encryption combined with a digital signature is not supported (v1)). Decide
which requirement wins before writing the call. Source:
src/pdf/styled-page-renderer.ts.
embedSource without a PDF/A-3 levelembedSource is honoured only with pdfA: 'PDF/A-3a' | 'PDF/A-3b' | 'PDF/A-3u',
and attachments are dropped under PDF/A-1 and PDF/A-2. Neither throws, so the
file looks right and carries nothing. Source: Ream.convertWithReport in
src/core/converter/ream.ts.
The signature declares SHA-256 as its digest, and WebCrypto signs an
RSASSA-PKCS1-v1_5 key with the hash the key was imported with. A key imported
with hash: 'SHA-384' or 'SHA-512' produces a signature every validator
rejects, without an error at signing time. Import RSA keys with
hash: 'SHA-256'. Source: src/pdf/signature.ts, src/core/crypto/cms.ts.
The options make Ream write the required structures; whether the file
conforms also depends on the content (fonts that cover every character,
alt text for figures in level a). Validate the output with veraPDF before
archiving, and read losses for characters drawn as boxes.
Any tool that rewrites the file after convert (optimizers, linearizers,
watermarking) breaks the signature's byte range. Do all other processing before
signing; if the pipeline needs a separate signing step, render with Ream first
and sign last.
verapdf --flavour 2b out.pdf (or 3b, ua1, …) passes.pdfsig out.pdf (poppler) or a PDF reader shows the signature as
valid for the signer's certificate.qpdf --show-encryption out.pdf shows AES-256 (R6) and the
permissions you set; the file asks for the user password when it is not empty.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
pdf-a, pdf-ua, digital-signature, pdf-encryption, reamkit, archival-pdf
npx claudepluginhub alex-krassavin/reamkit --plugin reamkit4 skills in this plugin
/convert-documentsUse when converting Word, Excel, PowerPoint or PDF files (.docx, .xlsx, .pptx, .pdf and legacy .doc, .xls, .ppt) to PDF, SVG, HTML, Markdown, DOCX or XLSX with reamkit (Ream) in a browser, Node.js, serverless or edge runtime: reading the bytes, choosing a target, opening a password-protected file, reading a PDF back as an editable document, and checking what the conversion lost.
/documents-to-markdownUse when extracting the text of user-uploaded documents (Word, Excel, PowerPoint, PDF or legacy .doc, .xls, .ppt files) as Markdown with reamkit (Ream) for a language-model prompt, a chat attachment, retrieval/RAG or search indexing, or a docs site, including what to do with pictures, slides, sheets and scanned PDFs.
/supply-fontsUse when a reamkit (Ream) PDF or SVG conversion has to run without network access (offline, air-gapped, a serverless function without egress, a strict Content-Security-Policy), must use the organisation's own typefaces or the fonts installed on the user's machine, or comes out with empty boxes, the wrong typeface or a font loss in its report. Not needed for HTML, Markdown, DOCX or XLSX output, which use no fonts.
Other plugins' skills for the same job