You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e92f27f
Browse filesBrowse the repository at this point in the historyBrowse files
M3: doc_open reads open parameters and link_open applies named destinations (storytold#3425)
Everything is reachable headlessly (AGENTS.md §3), so the open-parameter
parser moves from the app to pdfcraft_engine::open_parameters. doc_open
now splits `manual.pdf#page=2` the way the app does, only when the whole
path names no file, resolving the file part under --root. It reports the
destination as link_open does.
link_open and doc_open share destination_report, which looks a named
destination up in the target's /Names /Dests or catalog /Dests, instead
of reporting it as not applied.
Raised by CodeRabbit in review of storytold#5049.
t("doc_open","Open a PDF","Open a PDF file and return its document id, page count and whether it can be edited.")
141
+
t("doc_open","Open a PDF","Open a PDF file and return its document id, page count and whether it can be edited. A path that ends in open parameters, as help systems pass them (`manual.pdf#page=12`, `#nameddest=Intro` or `#Intro`), opens the file and reports its destination as link_open does; a path that names a file opens as it is.")
142
142
.cmd("file.open")
143
143
.with(schema(json!({"path":{"type":"string"},"password":{"type":"string","description":"User or owner password for encrypted files."}}),&["path"])),
144
144
t("doc_list","List open documents","List the open documents with their ids, page counts and unsaved state.").ro().with(schema(json!({}),&[])),
t("link_list","List links","Every link: page, 1-based index (for link_edit/link_delete), rect (points from the top-left of the page), and where it goes (url or to_page).")
653
653
.ro()
654
654
.with(schema(json!({"doc": doc()}),&["doc"])),
655
-
t("link_open","Open a linked PDF","Follow a local GoToR link in PdfCraft: open the referenced PDF as a new document, respecting --root. page and index use link_list numbering. Named destinations are reported but not applied. Absolute file specifications require allow_absolute: true after reviewing the target; relative links need no opt-in.")
655
+
t("link_open","Open a linked PDF","Follow a local GoToR link in PdfCraft: open the referenced PDF as a new document, respecting --root. page and index use link_list numbering. A named destination is looked up in the target, as the app does; one the target doesn't define is reported with a warning. Absolute file specifications require allow_absolute: true after reviewing the target; relative links need no opt-in.")
656
656
.with(schema(
657
657
json!({"doc": doc(),"page":{"type":"integer","minimum":1},"index":{"type":"integer","minimum":1},"password":{"type":"string","description":"Optional password for the linked PDF."},"allow_absolute":{"type":"boolean","description":"Explicitly allow an absolute local GoToR target (default false). Existing validation and --root confinement still apply."}}),
Copy file name to clipboardExpand all lines: crates/engine/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,7 @@ family (`sign`, `sign_with_timestamp`, `timestamp_document`, `embed_ltv`).
78
78
|`catalog`| Acrobat's "All tools" information architecture as data — groups, sections, icons, hues, and an `Availability` of `Ready`, `Planned(milestone)` or `Provider`. The UI renders what is *not* built yet, honestly |
79
79
|`actions`| PDF action dispatch (go-to, URI, named, set-layer-state, JavaScript) |
80
80
|`links`| Link creation, properties, and finding URLs in page text |
81
+
|`open_parameters`| A path's PDF open parameters (`manual.pdf#nameddest=Intro`, `#page=12`): the file to open and where to show it. The app and `doc_open` both read them |
81
82
|`js`| The bridge to `pdfcraft-js`. `forms` never depends on `js` directly; the engine injects it, so a build without JavaScript is possible |
82
83
|`xfa`, `ocr`, `compare`, `export`| Façades over the L3/L4 crates of the same names |
0 commit comments