Reference

API reference

Every function and type the engine exposes to Swift, C# and Rust, generated from the engine’s code (pagewerk-ffi 0.1.0), so it cannot drift from it.

93 functions (71 with a description), 88 types. Where the code has no description yet, the page says so. Functions with a browser tool have a live demo on their page.

Functions

Documents and pages

  • add_bookmarksNo description yet.
  • add_text_layerLays recognised words invisibly over the pages (the app recognises with Vision).
  • compare_documentsWord by word from old to new; every change with its page in both.
  • compare_lineOne line per change, as the report and the list show it.
  • compare_reportThe report PDF (Pro): the list, then each page pair with the changes marked.
  • compress LIVE DEMONo description yet.
  • crop_pages LIVE DEMONo description yet.
  • cuts_every LIVE DEMONo description yet.
  • delete_pages LIVE DEMONo description yet.
  • engine_versionThe engine build the app was linked against, for the About screen and bug reports.
  • escape_patternPlain words as a search pattern.
  • extract_pages LIVE DEMONo description yet.
  • flatten_fileforms_only: bake form answers, keep comments interactive.
  • images_to_pdfOne page per picture (JPEG, PNG, …), upright by the camera's EXIF flag.
  • is_encryptedNo description yet.
  • merge_atNo description yet.
  • merge_files LIVE DEMONo description yet.
  • number_pages LIVE DEMONo description yet.
  • organize_pagesNo description yet.
  • page_countNo description yet.
  • pages_as_imagesThe pages replaced by pictures of themselves at dpi, boxes painted in color first (Flatten "Seiten als Bilder", Schwärzen picture mode).
  • pdfium_availableNo description yet.
  • pdfium_initHands the engine the embedded PDFium library. Without it every tool still works; Reparieren and Schwärzen do less.
  • picture_is_blankAn (almost) empty scanned sheet: a speck of dust or a punched hole is fine.
  • pixel_changesWhere two page pictures differ (boxes on the new page).
  • place_imageUnterschreiben: an RGBA8 image onto one page, rect in display points (origin bottom-left).
  • privacy_clean LIVE DEMONo description yet.
  • privacy_findings LIVE DEMOWhat the file gives away, in rows for the Privacy Check.
  • privacy_report LIVE DEMONo description yet.
  • protect_file LIVE DEMONo description yet.
  • protect_with_rights LIVE DEMOSchützen with rights (Pro): what a reader may do; an empty password keeps the file open to read.
  • recognize_pagesTexterkennung: each page rendered at dpi, read by recognizer, the words laid invisibly over it. pages: None reads every page without text.
  • redact_areasSchwärzen without turning pages into pictures: covered glyphs leave the content stream, boxes go on top.
  • redact_patternsThe patterns Schwärzen offers (Pro), as regular expressions the engine's search takes.
  • repair_file LIVE DEMOReparieren: a damaged file made readable, written anew.
  • replace_pages_with_imagesSchwärzen: replace each page by a JPEG of itself with the boxes burnt in.
  • rotate_pages LIVE DEMONo description yet.
  • set_font_locatorOnce at start-up. Without it such text shows as gaps.
  • split_pages LIVE DEMOcuts: pages after which a new part starts.
  • text_to_pdfText in PDF: laid out by the engine with its own font, the same on every platform. footer: "Seite {n} von {N}".
  • unlock_file LIVE DEMONo description yet.
  • upright_turnsAutomatisch ausrichten: each page read four ways (small render, turned by the engine); a page turns where its text reads clearly better.
  • watermark LIVE DEMONo description yet.

Tools

  • conversion_capThe page cap, for the app's page range.
  • options_from_jsonNo description yet.
  • options_summaryThe options in a few words, for the history and workflow steps.
  • options_to_jsonOptions as JSON, for workflows and the history.
  • resolve_placeholdersStamp text as it is set: {date} / {Datum} become the day the tool runs ("23.10.2026", "23 October 2026"), so a saved workflow stamps today's date, not the day it was saved. The apps show previews with this too.
  • run_toolRuns options on inputs. Tools that take one file run once per input (a file that fails does not stop the rest); Merge, Compare, Bilder in PDF and Scan take all inputs together.
  • run_tool_batchrun_tool with batch rules even for one file: the whole file, whatever page range the options name (Seitenzahlen, Wasserzeichen, Zuschneiden, PDF in Bilder, Texterkennung on every page without text).
  • scan_orderFronts first, then the turned stack: backs come in reverse.
  • set_conversion_capsHow far In Word and In Excel go in one run; a phone sets lower caps than a desktop. Over max_pages the tool refuses (code "too-many-pages") and the app offers a page range; In Excel stops at a page boundary when it reaches max_cells words or max_seconds, and its report says so (cut_by).
  • set_utc_offsetThe device's offset from UTC in seconds, so {date} is the local day. The apps call it at launch and when the time zone changes.
  • uses_proPro is needed for these options on a file of page_count pages, run on file_count files (several at once is always Pro).
  • watermark_logo_areasNo description yet.

Rules and helpers

  • batch_label"24 Dateien komprimieren"
  • earlier_versions"1 früherer Stand" / "3 frühere Stände" (Privacy Check, earlier saved versions).
  • find_tablesThe tables on the first 20 pages, for the document screen's suggestion. Run it in the background after a file opens; nothing when In Excel is off.
  • format_bytes"4,2 MB" / "4.2 MB"; under 1 MB in KB.
  • format_page_range0-based pages → "1-3, 5" (the inverse of parse_page_range).
  • options_tool_idNo description yet.
  • parse_page_range"2, 5-7, 10-" (1-based, as typed) → 0-based pages in order, no repeats. "5-" runs to the last page, "-3" from the first. None when a part does not parse or lies outside 1…count.
  • pro_free_leftFree Pro uses left (0 for subscribers: they need none).
  • pro_may_useA Pro choice may run now: subscribed, or a free use is left.
  • redact_findEvery place on every page the query finds, one box per line, and every form field whose value holds it (one box over the field: redacting it takes the field out of the form).
  • redact_pattern_errorWhy an own pattern (Pro) cannot be searched for, in words; None when it can (an empty one is simply not searched). The engine's own check, so the app's "Ungültiges Muster" agrees with what the search does.
  • redact_termsWhat ToolOptions::Redact.terms should carry for these hits: each text found once, plus the words typed.
  • result_name"Mietvertrag.pdf" + "klein" → "Mietvertrag-klein". A suffix the name already ends with ("Fotos" + "fotos") or one that only names the format ("pdf") is left off.
  • save_resultfolder/name.ext, or folder/name 2.ext, … when that is taken. Writes the file and returns its path.
  • set_convertersWhich converters this build offers ("toWord", "toExcel"); the others leave the tool lists. The apps call it at launch.
  • signature_fontThe handwriting font itself, so the apps can show the name while it is typed.
  • size_change"−62 %", or "±0 %" when it did not get smaller.
  • split_size_cutsPro preview: where to cut so that no part is larger than max_mb. The same measurement the tool uses (shared fonts count once per part).
  • stamp_text_widthHow wide the stamp will set text (points), for previews that must match.
  • suggestionsThe tools that fit this file, shown first.
  • tool_catalogEvery tool with what the apps need to list and offer it.
  • tool_groupsThe tool list, in groups.
  • tool_nameThe tool's name for people, by id.
  • top_workflowsAt most three for the open file: the fitting ones first, then the pinned.
  • typed_signatureA typed signature as a PNG in the bundled handwriting font, height px high.
  • workflow_fitsIt fits this file: a scan and a Texterkennung step, or a big file and Komprimieren.

Workflows and history

  • needs_passwordThese options cannot run as stored: Schützen or Entsperren without its password (the history and workflows never keep one). Ask, then options_with_password.
  • options_with_passwordThe same options with the password the person just typed.
  • run_workflowRuns each enabled step on the result of the one before; the file is never written in between. Texterkennung on a file that already has text is skipped, not an error; any other failing step stops the run and says which.
  • sanitizeA file name that saves anywhere: no path separators, no leading dots, not too long.
  • tool_titleThe tool's name for people.
  • workflow_chain"Texterkennung → Komprimieren"
  • workflow_templatesWhat a new user can start from.
  • workflow_uses_proPro is needed to run this workflow on a file of page_count pages.

Forms

  • form_stepsThe steps, in reading order: page by page, top to bottom. Read-only fields and buttons are no steps.
  • format_form_dateA day in an Acrobat date pattern (yyyy yy mmmm mmm mm m dd d; times as midnight): what the file's own scripts would accept.
  • parse_form_dateThe day a value means in pattern (numbers and month names), for the calendar to start on; None when it doesn't read as one.

Licence

  • set_licenseThe app's licence key (EL1....). Returns what the engine made of it.

Types

Objects

  • LibraryWorkflows and history, saved as one JSON file in folder.
  • PdfDocAn open PDF: what the apps show and look into. One per file; closed when the last reference goes.

Callback interfaces

  • FontLocatorWhat a platform brings for stamp text the bundled font cannot draw (Chinese, Arabic, Hebrew …): which of its fonts draws a text (Apple: CoreText's fallback, Windows: DirectWrite's). The engine opens the file, lays the text out and embeds only the glyphs it uses.
  • TextRecognizerThe one thing a platform has to bring for Texterkennung: words in a picture (Apple: Vision, Windows: Windows.Media.Ocr). Everything around it, from rendering the page to writing the invisible text, is the engine's.

Records

Enums

Errors