Files
CamWight 76fc02a9bc Drawing export: a drawing's sheets as the pages of one PDF (#4890) (#9647)
* Paper PDF: sheets as the pages of one document (#4890 P1)

`paper_pdf_pages` writes several prepared scenes as the pages of one PDF, in order, each page its
own sheet's size. `paper_pdf` is now its one-page call and writes the same bytes as before.
- Object numbers come from one counter in the order the objects are written: the catalog, the page
  tree, each page then its content, the Info dictionary, then the layers. One page keeps 1 to 5 and
  layers from 6, as now. P2's fonts can take their numbers from the same counter.
- One layer for each kind across all pages, tagged as it is first painted, so a kind is the same
  layer on every page. Each page lists only the layers it paints.
- The pages share one allowance of content, `MAX_DRAWING_BYTES`. A document has 1 to 1000 pages
  (a drawing's sheets), and every page meets the one-page size check.
Tests, under their own heading in `pdf_tests.rs`: one page is the one-page call byte for byte, with
and without layers, a title and a date; three sheets of different sizes as pages in order, sharing
layers; the page limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Paper PDF: the pages on drawings, each page's layers by the one painted test (#4890 P1)

Replayed onto the rebased #7626. A page lists the layers of the kinds it
paints, now by the writer's one painted test (a stroke or a fill), so a
page whose group of a kind holds only text or pictures doesn't list that
kind's layer. The pages' tests build scenes with Scene::new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Paper PDF: pages are put on the grid one at a time, as they are written (#4890 P1)

paper_pdf_pages put every page on the grid before it wrote the first. Each page's
grid is capped, but up to 1000 pages of them were held at once, only to learn the
page sizes and the layers. The prepared scenes already say both.

Now a first pass reads each page's size and the layers from the scenes, and the
write loop puts one page on the grid just before it writes it, then drops it.
`painted` is asked of the scene's groups: each prepared stroke and fill stays one
on the grid, in order, and the loop refuses a page whose groups don't match. The
object numbers, the write order and the bytes are the same: the byte pins (the A3
sample, one page against pages, pages in order, the later page's 3 pt refusal)
pass as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 15:32:19 -05:00
..