Properties of the Dublin Core, XMP Basic, Rights Management, Media
Management, Basic Job Ticket, Paged-Text, Dynamic Media, Adobe PDF,
Photoshop and Camera Raw namespaces must have the types ISO 16684-1
clause 8 and XMP Specification Part 2 give them: simple values by their
lexical form, arrays by kind and items, structures by their fields, in
every RDF/XML form a value can take. xmp::parse is shared with the
identification read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
The Claims review of fd4b698c7:
- The predictor test's rows are tagged Up, not None: read without the
predictor, None rows leave only zero bytes, which a CMap's parser
skips, so its ToUnicode part passed without the fix.
- embedded_sfnt_within's comment and its test's doc gave guessed
meanings as the reason no copy is adapted; it is the metrics read past
the allowance, the widths' read of the program again included.
- The full-map test is named for the filters it covers, and the docs of
Reads::decode, MAX_CMAP_BYTES and the own-limit test carry the
conditions they hold under.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
The first /ID string is kept only when a conforming file can hold it:
non-empty and within 32767 bytes (ISO 32000-1 Annex C). The report says
"Completed the file identifier" when it was kept and "Added a file
identifier" when both strings are new.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
The first /ID string is the file's permanent identifier (ISO 32000-1
14.4); when it is a non-empty string, conversion keeps it and makes only
the second afresh. The test also checks that a good /ID is left as it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
The PDF 1.2 SetState and NOP actions, which ISO 32000-1 no longer
defines, are forbidden, and a Named action may only name NextPage,
PrevPage, FirstPage or LastPage (ISO 32000-1 Table 212). Save as PDF/A
removes the others as it does other forbidden actions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
The trailer the last startxref points to (an update's, or a linearized
file's first-page trailer) must have an /ID of two non-empty strings
(ISO 32000-1 14.4). Save as PDF/A gives a document without a good one a
new identifier, made by the writer's generator, now public in cos as
new_file_id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
Gray, Red, Green and Blue are primary colour components as well as Cyan,
Magenta, Yellow and Black (ISO 32000-1 10.5.5.6, ISO 32000-2 10.6.5.6):
their halftones need no transfer function and may not have one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
Document::get fetches by object number, so references that differ only
in generation reach the same object; the reached and read sets now go
by number, and each object is walked once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
Objects are followed from the trailer through a queue of references,
never into /PieceInfo, so an object only private data refers to is not
read as a graphics state holder. /HalftoneType must be an integer
(ISO 32000-1 Table 128); a real of the same value is reported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
Graphics states come from /Resources and /DR entries and from shading
patterns, never from private /PieceInfo data, and maps shared by
reference are read once. A halftone without a /HalftoneType, a
rendering intent that isn't a name, and a halftone /TransferFunction
where it isn't allowed or is missing (non-primary colorants of a type 5
halftone need one; ISO 32000-1 Table 130) are reported. A null entry
counts as absent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
Keeps main's reworded mono-image text and the target_bytes paragraph in the doc_optimize description.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An engine test converts files without a binary comment and with a 2.0
header, saves them through Session::save_bytes and verifies the
reopened bytes; the preflight test adds a good version with a short
comment, and a good header that conversion leaves alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
A graphics state may not have /TR, may have /TR2 only as /Default, may
use halftones of type 1 or 5 only and without /HalftoneName (also the
colorant halftones of a type 5 one), and a rendering intent from ISO
32000-1 Table 70. Graphics states are read from every /ExtGState
resource dictionary and from shading patterns.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
The file must start with %PDF-1.0 to %PDF-1.7 and an end-of-line marker,
followed by a comment of % and four bytes above 127. A document whose
next save is a full rewrite is judged by the header that save writes.
Save as PDF/A makes the next save full, at version 1.7 when the kept
version isn't 1.0 to 1.7.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
A /Colorants entry counts only as a Separation space of its own colorant
(ISO 32000-1 8.6.6.5, Table 71). Tint-transform and other streams compare
by decoded data, so the same function stored under another filter is the
same. Equal reference pairs are remembered and comparisons are bounded,
so a structure shared by many definitions is compared once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
A draw's fit passes ran on after one had spent the budget, each a full
measure, before the draw was refused; each pass now checks the budget before
it starts and after it ends. The final layout pass, which expands the
embedded values once more, is checked too, so the draw that crosses the
budget there is refused even when it is the form's last. (CodeRabbit review
on #5852.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn
Finishes the clause. Table C.1 of ISO 32000-1 Annex C bounds real values
at about ±3.403 × 10^38 and character identifiers at 65535. A real past
that range (an integer token too long even for a real reads as one) is
reported, and so is an embedded CMap of a Type 0 font, or one it uses
through /UseCMap, whose begincidrange entry reaches past CID 65535 or
whose begincidchar entry names one (ISO 32000-1 9.7.5.4). A CMap named
rather than embedded is a predefined one, within the limit. The CMaps are
decoded within one 16 MiB allowance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn