PDF kit command
file.compare
Compare files
Compare the text of two open documents: other is the older version, doc the newer. Returns counts and each change (replaced, inserted, deleted) with the old and new text, pages (1-based) and rectangles (points, origin bottom-left).
- Kit
- PDF 0.1.0 (.pdf)
- Changes the document
- no
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | List at most this many changes (default 500). (minimum 1) |
other | integer | yes | The older document (from doc_open). |
visual | boolean | no | Also compare how pages look (page n with page n): regions that differ visually. |
Call through pdf_run
text
pdf_run {
"path": "<file>.pdf",
"steps": [{ "command": "file.compare", "params": { "other": <integer> } }]
}The required parameters, with placeholders for their types: not a tested example. Optional: limit, visual. pdf_run answers the step’s result in completed[i].result.
Result
Result JSON Schema
json
{
"additionalProperties": true,
"description": "the differences between the two documents, page by page",
"type": "object"
}Parameter schema
json
{
"additionalProperties": false,
"properties": {
"limit": {
"description": "List at most this many changes (default 500). (minimum 1)",
"type": "integer"
},
"other": {
"description": "The older document (from doc_open).",
"type": "integer"
},
"visual": {
"description": "Also compare how pages look (page n with page n): regions that differ visually.",
"type": "boolean"
}
},
"required": [
"other"
],
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (pdf_commands through @kition/[email protected], built from KitionAI/kition-pdf@b0d2725). As data: commands.jsonl.