Palimpsest documentation
The revision workbench
Keep an alternative edit, compare it with the original, and decide exactly which changes belong in the main document.
Work on a branch
Every imported document begins with main. A branch starts at a chosen revision, shares the same immutable source PDFs, and advances independently when edited. In the native reader, open History to create or switch branches. On the command line, specify the branch with each edit.
polypdf --library data branch 1 editorial
polypdf --library data edit 1 --branch editorial rotate 1
polypdf --library data show 1 --revision branch:editorialLibrary-wide passage retrieval follows the main revision. A source citation that already identifies a retained revision can still resolve against that revision.
Name a moment
A checkpoint is an immutable name for a revision. Save one before review or export. Subsequent edits leave it pointing to the same snapshot. Its name is local to the document.
polypdf --library data checkpoint 1 before-review
polypdf --library data refs 1
polypdf --library data edit 1 restore checkpoint:before-reviewThe restore command above creates a new revision on main. To restore a branch, supply its name using --branch before the operation.
Compare document structure
Select two revisions to inspect their page sequences. Each changed source page has a before and after list of occurrences. An occurrence includes its position in the reader, rotation and annotation data. A page may occur more than once after duplication. The comparison preserves each occurrence in the report.
polypdf --library data compare 1 checkpoint:before-review branch:editorialSee the changed pixels
Compare any page from the first revision with any page from the second. Both render at a common longest edge with their upper-left corners aligned. The overlay fades identical samples and colors differences. The result includes both raster sizes, the number of differing pixels and a bounding rectangle with exclusive right and bottom edges.
polypdf --library data pixel-diff 1 main branch:editorial changes.png --before-page 1 --after-page 1 --pixels 1000Rotations and visible markup affect the rendered result. A comparison at one raster size describes those renders. Text extraction, metadata and cryptographic signatures need separate inspection.
A highlight, measured
In the rainfall sheet, a reviewer marked the station name Birch. At 800 pixels on the longest edge, the renderer found 972 differing samples out of 480,000. These excerpts show the same area of all three renders. Select one to inspect the whole page.
Merge a reviewed branch
Preview a merge into the branch you are editing. PolyPDF finds the branches’ shared ancestor. A target that is already an ancestor can advance directly. Divergent histories use a three-way comparison of page layouts, rotations and marks. A merge of divergent histories records both parent revisions.
polypdf --library data merge-branch 1 editorial --into mainInspect the reported base, target, source and conflicts. Keep the two head IDs from that preview. Applying the merge checks both again within the write transaction. If a branch advanced, preview again.
polypdf --library data merge-branch 1 editorial --into main --apply --expected-target "$target" --expected-source "$source"For each unresolved choice, use the native conflict controls or add --resolve KEY=target or --resolve KEY=source. In a divergent edit involving ambiguous repeated pages, the preview asks which complete snapshot to keep. Local branches and checkpoints survive a restart and are included in a whole-library backup.


