API-Referenz
Jede Klasse, Methode und Funktion des NexPDF-Rust-SDK, nach Funktion gruppiert. Generiert aus NexPDF 1.1.0.
Generiert aus NexPDF 1.1.0
Diese Seite wird aus dem Quellcode von nexpdf-sdk (use nexpdf_sdk) generiert. Sie listet 244 Mitglieder auf. Optionen und Ergebnisse, die JSON-Strings sind, verwenden in jedem NexPDF-SDK dasselbe JSON. Modul ist das Lizenzmodul, das ein Aufruf braucht; Aufrufe, die als „immer verfügbar“ markiert sind, funktionieren ohne Lizenzschlüssel.
Aufrufe geben nexpdf_sdk::Result<T> zurück. Mit dem Feature serde hat jeder *_json-Aufruf auch einen Zwilling *_json_value, der einen serde_json::Value zurückgibt.
Einrichtung und Lebenszyklus
from_bytes_with_password
pub fn from_bytes_with_password(data: &[u8], password: &str) -> Result<Document>Wie from_bytes, öffnet aber ein verschlüsseltes PDF mit password (Office-Dateien, Bücher und Comics haben kein PDF-Passwort und ignorieren es).
Auf Document
open
pub fn open(path: impl AsRef<Path>) -> Result<Document>Liest und öffnet eine Datei; siehe from_bytes.
Auf Document
open_with_password
pub fn open_with_password(path: impl AsRef<Path>, password: &str) -> Result<Document>Liest und öffnet eine verschlüsselte Datei; siehe from_bytes_with_password.
Auf Document
save
pub fn save(&self, path: impl AsRef<Path>) -> Result<()>Schreibt das Dokument nach path.
Auf Document
save_linearized_to
pub fn save_linearized_to(&self, path: impl AsRef<Path>) -> Result<()>Schreibt eine linearisierte Datei („Fast Web View“) nach path.
Auf Document
try_clone
pub fn try_clone(&self) -> Result<Document>Eine unabhängige Kopie (für Snapshots zum Rückgängigmachen oder um in einem anderen Thread zu arbeiten).
Auf Document
as_ptr
pub fn as_ptr(&self) -> *const sys::NexPdfDocumentDas rohe Handle, zum Aufrufen von sys-Funktionen, die einen const NexPdfDocument * nehmen.
Auf Document
as_mut_ptr
pub fn as_mut_ptr(&mut self) -> *mut sys::NexPdfDocumentDas rohe Handle, zum Aufrufen von sys-Funktionen, die das Dokument verändern.
Auf Document
into_raw
pub fn into_raw(self) -> *mut sys::NexPdfDocumentGibt den Besitz auf; geben Sie das Handle mit sys::nexpdf_free frei.
Auf Document
status_json
pub fn status_json() -> Result<String>Die aktive Lizenz als JSON (nexpdf_license_status_json), einschließlich ihrer "modules".
Auf nexpdf_sdk::license
is_licensed
pub fn is_licensed(module: &str) -> boolOb die aktive Lizenz module freischaltet (annotations, forms, editor, security, redaction, signatures, conversion, ocr, standards).
Auf nexpdf_sdk::license
zip_kind
pub fn zip_kind(data: &[u8]) -> ZipKindKlassifiziert data. Liest die Eintragsnamen aus dem zentralen Verzeichnis des ZIP; dekomprimiert nie.
Auf nexpdf_sdk
Bibliothek und Lizenzierung
version
pub fn version() -> StringDie Version der Engine.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_version
activate
pub fn activate(key_or_xml: &str, platform: &str, app_id: &str) -> Result<Activation>Aktiviert einen Lizenzschlüssel oder eine Lizenz-XML für den Prozess. Gibt 2 (lizenziert), 1 (Test) oder einen negativen Fehlercode zurück (-1 fehlerhaft, -2 ungültige Signatur, -3 nicht unterstützte Version, -4 abgelaufen, -5 noch nicht gültig, -6 falsche Plattform, -7 falsche App-ID).
Auf nexpdf_sdk::license · immer verfügbar · C nexpdf_license_activate
license_status_json
pub fn license_status_json() -> Result<String>Die aktive Lizenz als JSON: state (unlicensed, trial oder licensed), licensee, id, tier, modules, expires_at, days_left und watermark.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_license_status_json
license_status_json_value
pub fn license_status_json_value() -> Result<serde_json::Value>Die aktive Lizenz als JSON: state (unlicensed, trial oder licensed), licensee, id, tier, modules, expires_at, days_left und watermark.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_license_status_json
last_error
pub fn last_error() -> Option<String>Warum der letzte Aufruf in diesem Thread fehlgeschlagen ist, oder nichts.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_last_error
invoke
pub fn invoke(request_json: impl StrArg) -> Result<String>Die gesamte API hinter einem JSON-Aufruf, für Bridges, die nur Strings übergeben: {"fn":"to_xlsx","args":[handle]} gibt {"ok":true,"result":...} oder {"ok":false,"error":"..."} zurück. Dokumente sind Handle-Nummern und Byte-Puffer Base64.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_invoke
register_standard_font
pub fn register_standard_font(data: &[u8]) -> Result<i32>Registriert eine zu Helvetica, Times oder Courier kompatible TrueType-Schrift (zum Beispiel Liberation), die für nicht eingebettete Standardschriften und PDF/A verwendet wird. Nur für Builds ohne mitgelieferte Schriften nötig. 1 bei Erfolg, 0, wenn die Schrift keine solche Schrift ist.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_register_standard_font
has_bundled_fonts
pub fn has_bundled_fonts() -> Result<i32>1, wenn die Liberation-Schriften einkompiliert sind, 0 in den schlankeren Builds.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_has_bundled_fonts
Öffnen und Speichern
from_bytes
pub fn from_bytes(data: &[u8]) -> Result<Document>Öffnet ein PDF aus Bytes. JPEG-, PNG- und TIFF-Bilder werden ebenfalls akzeptiert (eine Seite pro Bild).
Auf Document · immer verfügbar · C nexpdf_open_bytes
open_bytes_with_password
pub fn open_bytes_with_password(data: &[u8], password: impl StrArg) -> Result<Document>Öffnet ein verschlüsseltes PDF mit seinem Benutzer- oder Besitzerpasswort (RC4, AES-128, AES-256). Schlägt mit „password required“ oder „incorrect password“ fehl, wenn das Passwort das Problem ist.
Auf Document · immer verfügbar · C nexpdf_open_bytes_with_password
from_html
pub fn from_html(html: impl StrArg) -> Result<Document>Layoutet HTML als neues PDF-Dokument.
Auf Document · Modul conversion · C nexpdf_from_html
open_office
pub fn open_office(data: &[u8]) -> Result<Document>Konvertiert Word-, Excel- oder PowerPoint-Bytes (Format wird erkannt) in ein neues PDF-Dokument.
Auf Document · Modul conversion · C nexpdf_open_office
open_ebook
pub fn open_ebook(data: &[u8]) -> Result<Document>Konvertiert EPUB, FictionBook (.fb2, .fb2.zip), XPS/OpenXPS oder ein CBZ-Comic-Archiv in ein neues PDF-Dokument.
Auf Document · Modul conversion · C nexpdf_open_ebook
open_image
pub fn open_image(data: &[u8]) -> Result<Document>Konvertiert JPEG-, PNG- oder TIFF-Bytes in ein neues PDF, eine Seite pro Bild.
Auf Document · immer verfügbar · C nexpdf_open_image
save_bytes
pub fn save_bytes(&self) -> Result<Vec<u8>>Das Dokument mit jeder Änderung als PDF-Bytes (vollständiges Neuschreiben).
Auf Document · immer verfügbar · C nexpdf_save_bytes
save_linearized
pub fn save_linearized(&self) -> Result<Vec<u8>>Ein linearisiertes PDF („Fast Web View“): Die erste Seite erscheint, bevor der Download endet.
Auf Document · immer verfügbar · C nexpdf_save_linearized
Seiten und Rendering
page_count
pub fn page_count(&self) -> Result<i32>Anzahl der Seiten.
Auf Document · immer verfügbar · C nexpdf_page_count
page_width
pub fn page_width(&self, page_index: usize) -> f64Angezeigte Seitenbreite in Punkt (Beschnittrahmen, Rotation und /UserUnit angewendet).
Auf Document · immer verfügbar · C nexpdf_page_width
page_height
pub fn page_height(&self, page_index: usize) -> f64Angezeigte Seitenhöhe in Punkt (Beschnittrahmen, Rotation und /UserUnit angewendet).
Auf Document · immer verfügbar · C nexpdf_page_height
page_view_json
pub fn page_view_json(&self, page_index: usize) -> Result<String>Wie die Seite angezeigt wird: width, height, rotation, user_unit, crop und die Matrix to_display von PDF zur Anzeige.
Auf Document · immer verfügbar · C nexpdf_page_view_json
page_view_json_value
pub fn page_view_json_value(&self, page_index: usize) -> Result<serde_json::Value>Wie die Seite angezeigt wird: width, height, rotation, user_unit, crop und die Matrix to_display von PDF zur Anzeige.
Auf Document · immer verfügbar · C nexpdf_page_view_json
render_page_png
pub fn render_page_png(&self, page_index: usize, dpi: f64) -> Result<Vec<u8>>Rendert eine Seite als PNG mit der angegebenen Auflösung (Punkte pro Zoll). Renderings ohne Lizenz und mit Testschlüssel tragen ein Wasserzeichen.
Auf Document · immer verfügbar · C nexpdf_render_page_png
render_thumb_png
pub fn render_thumb_png(&self, page_index: usize, max_dim: u32) -> Result<Vec<u8>>Rendert ein PNG als Miniaturansicht, dessen längere Seite höchstens max_dim Pixel misst.
Auf Document · immer verfügbar · C nexpdf_render_thumb_png
set_overprint
pub fn set_overprint(&mut self, mode: i32) -> Result<i32>Überdruckensimulation für spätere Renderings: 0 = nur PDF/X-Dokumente (Standard), 1 = immer, 2 = nie.
Auf Document · immer verfügbar · C nexpdf_set_overprint
Text, Suche und Assistent
extract_page_text
pub fn extract_page_text(&self, page_index: usize) -> Result<String>Der Text einer Seite in Lesereihenfolge.
Auf Document · immer verfügbar · C nexpdf_extract_page_text
extract_markdown
pub fn extract_markdown(&self) -> Result<String>Das gesamte Dokument als Markdown (Überschriften, Listen, Tabellen).
Auf Document · immer verfügbar · C nexpdf_extract_markdown
search_json
pub fn search_json(&self, query: impl StrArg) -> Result<String>Findet einen Text auf jeder Seite (ohne Beachtung der Groß- und Kleinschreibung). Gibt ein JSON-Array mit Treffern zurück: page, context und das Rechteck llx, lly, urx, ury in PDF-Punkten.
Auf Document · immer verfügbar · C nexpdf_search_json
search_json_value
pub fn search_json_value(&self, query: impl StrArg) -> Result<serde_json::Value>Findet einen Text auf jeder Seite (ohne Beachtung der Groß- und Kleinschreibung). Gibt ein JSON-Array mit Treffern zurück: page, context und das Rechteck llx, lly, urx, ury in PDF-Punkten.
Auf Document · immer verfügbar · C nexpdf_search_json
page_blocks_json
pub fn page_blocks_json(&self, page_index: usize) -> Result<String>Die Textblöcke einer Seite als JSON: text, Schriftgröße size und das Rechteck llx, lly, urx, ury.
Auf Document · immer verfügbar · C nexpdf_page_blocks_json
page_blocks_json_value
pub fn page_blocks_json_value(&self, page_index: usize) -> Result<serde_json::Value>Die Textblöcke einer Seite als JSON: text, Schriftgröße size und das Rechteck llx, lly, urx, ury.
Auf Document · immer verfügbar · C nexpdf_page_blocks_json
ask_document
pub fn ask_document(&self, question: impl StrArg, k: u32, max_chars: u32) -> Result<String>Offline-Retrieval des Dokumentassistenten (BM25): die k für eine Frage relevantesten Passagen und ein seitenmarkierter Kontext von höchstens max_chars Zeichen (0 = 200000), der an ein Sprachmodell gesendet werden kann. Gibt {"passages":[{"page","text","score"}],"context":"...","context_pages":[...]} zurück.
Auf Document · immer verfügbar · C nexpdf_ask_document
page_words_json
pub fn page_words_json(&self, page_index: usize, options_json: impl StrArg) -> Result<String>Die Wörter einer Seite mit exakten Rahmen aus den Glyphenbreiten und dem Textzustand: text, bbox, quad (folgt gedrehtem Text), font, size, angle, line. {"glyphs":true} fügt die Glyphenrahmen hinzu.
Auf Document · immer verfügbar · C nexpdf_page_words_json
page_words_json_value
pub fn page_words_json_value( &self, page_index: usize, options_json: impl StrArg, ) -> Result<serde_json::Value>Die Wörter einer Seite mit exakten Rahmen aus den Glyphenbreiten und dem Textzustand: text, bbox, quad (folgt gedrehtem Text), font, size, angle, line. {"glyphs":true} fügt die Glyphenrahmen hinzu.
Auf Document · immer verfügbar · C nexpdf_page_words_json
Konvertierung
to_html
pub fn to_html(&self) -> Result<String>Das Dokument als HTML.
Auf Document · Modul conversion · C nexpdf_to_html
to_json
pub fn to_json(&self) -> Result<String>Der Dokumentinhalt als JSON.
Auf Document · Modul conversion · C nexpdf_to_json
to_json_value
pub fn to_json_value(&self) -> Result<serde_json::Value>Der Dokumentinhalt als JSON.
Auf Document · Modul conversion · C nexpdf_to_json
to_xml
pub fn to_xml(&self) -> Result<String>Der Dokumentinhalt als XML.
Auf Document · Modul conversion · C nexpdf_to_xml
to_csv
pub fn to_csv(&self) -> Result<String>Tabellen des Dokuments als CSV.
Auf Document · Modul conversion · C nexpdf_to_csv
to_rtf
pub fn to_rtf(&self) -> Result<String>Das Dokument als RTF.
Auf Document · Modul conversion · C nexpdf_to_rtf
to_docx
pub fn to_docx(&self) -> Result<Vec<u8>>Das Dokument als Word-Datei (.docx).
Auf Document · Modul conversion · C nexpdf_to_docx
to_xlsx
pub fn to_xlsx(&self) -> Result<Vec<u8>>Das Dokument als Excel-Arbeitsmappe, ein Tabellenblatt pro Seite.
Auf Document · Modul conversion · C nexpdf_to_xlsx
to_pptx
pub fn to_pptx(&self) -> Result<Vec<u8>>Das Dokument als PowerPoint-Präsentation, eine Folie pro Seite.
Auf Document · Modul conversion · C nexpdf_to_pptx
to_reflow_html
pub fn to_reflow_html(&self, options_json: impl StrArg) -> Result<String>Der Text als responsives HTML für kleine Bildschirme. Optionen (dürfen entfallen): {"pages":[0],"images":true,"full_page":true,"title":"..."}.
Auf Document · Modul conversion · C nexpdf_to_reflow_html
open_xlsx_with_clock
pub fn open_xlsx_with_clock(data: &[u8], clock_unix_seconds: f64) -> Result<Document>Konvertiert eine Excel-Arbeitsmappe mit fester Uhr: NOW() und TODAY() in Formeln ohne zwischengespeicherten Wert geben die angegebene Unix-Zeit zurück (Sekunden, ohne Zeitzone).
Auf Document · Modul conversion · C nexpdf_open_xlsx_with_clock
open_docx_with_options_json
pub fn open_docx_with_options_json(data: &[u8], options_json: impl StrArg) -> Result<Document>Konvertiert ein Word-Dokument mit den Optionen {"show_comments":false,"show_revisions":false}: Kommentare in Sprechblasen in einem Korrekturbereich und nachverfolgte Änderungen als Markup gezeichnet statt des endgültigen Dokuments.
Auf Document · Modul conversion · C nexpdf_open_docx_with_options_json
Vorlagen
template_docx_to_pdf
pub fn template_docx_to_pdf( template_bytes: &[u8], data_json: impl StrArg, options_json: impl StrArg, ) -> Result<Document>Füllt eine Word-Vorlage mit JSON-Daten und konvertiert sie in ein neues PDF-Dokument. Optionen: {"strict":false,"locale":"en"}; mit strict lässt ein fehlendes Feld den Aufruf fehlschlagen.
Auf Document · Modul conversion · C nexpdf_template_docx_to_pdf
template_docx_fill
pub fn template_docx_fill(template_bytes: &[u8], data_json: impl StrArg) -> Result<Vec<u8>>Füllt eine Word-Vorlage mit JSON-Daten und gibt die neuen .docx-Bytes zurück.
Auf nexpdf_sdk · Modul conversion · C nexpdf_template_docx_fill
template_html_to_pdf
pub fn template_html_to_pdf( html_utf8: impl StrArg, data_json: impl StrArg, options_json: impl StrArg, ) -> Result<Document>Füllt eine HTML-Vorlage mit JSON-Daten (Werte HTML-maskiert, {{{raw}}} nicht) und layoutet sie als neues PDF-Dokument.
Auf Document · Modul conversion · C nexpdf_template_html_to_pdf
template_fill_pdf
pub fn template_fill_pdf( &mut self, data_json: impl StrArg, options_json: impl StrArg, ) -> Result<i32>Füllt eine PDF-Vorlage an Ort und Stelle: AcroForm-Felder nach Namen und Platzhalter im Seitentext. Optionen {"flatten","fields","text","strict","locale"}. Gibt die Anzahl der gefüllten Felder und Textzeilen zurück.
Auf Document · Modul conversion · C nexpdf_template_fill_pdf
template_docx_fill_with
pub fn template_docx_fill_with( template_bytes: &[u8], data_json: impl StrArg, options_json: impl StrArg, ) -> Result<Vec<u8>>Füllt eine Word-Vorlage mit JSON-Daten und den Optionen {"strict","locale"} und gibt die neuen .docx-Bytes zurück.
Auf nexpdf_sdk · Modul conversion · C nexpdf_template_docx_fill_with
Office-Bearbeitung
xlsx_edit
pub fn xlsx_edit(data: &[u8], edits_json: impl StrArg) -> Result<Vec<u8>>Setzt Zellen einer Excel-Arbeitsmappe (Zahlen, Text, Boolesche Werte, Formeln oder null zum Leeren), berechnet jede Formel und die Diagramme neu und gibt die neuen .xlsx-Bytes zurück. JSON {"sheet","edits":[{"cell","value"}],"ranges":[{"start","rows"}],"recalculate"}.
Auf nexpdf_sdk · Modul conversion · C nexpdf_xlsx_edit
xlsx_cells_json
pub fn xlsx_cells_json(data: &[u8], options_json: impl StrArg) -> Result<String>Die Zellen einer Excel-Arbeitsmappe als JSON: pro Tabellenblatt jede Zelle mit Typ, Wert und Formel. Optionen {"sheet","range","recalculate"}.
Auf nexpdf_sdk · Modul conversion · C nexpdf_xlsx_cells_json
xlsx_cells_json_value
pub fn xlsx_cells_json_value(data: &[u8], options_json: impl StrArg) -> Result<serde_json::Value>Die Zellen einer Excel-Arbeitsmappe als JSON: pro Tabellenblatt jede Zelle mit Typ, Wert und Formel. Optionen {"sheet","range","recalculate"}.
Auf nexpdf_sdk · Modul conversion · C nexpdf_xlsx_cells_json
docx_edit
pub fn docx_edit(data: &[u8], ops_json: impl StrArg) -> Result<Vec<u8>>Wendet Operationen auf ein Word-Dokument an und gibt die neuen .docx-Bytes zurück: replace (über Runs, Kopf- und Fußzeilen hinweg), set_text, insert und delete für Absätze.
Auf nexpdf_sdk · Modul conversion · C nexpdf_docx_edit
docx_paragraphs_json
pub fn docx_paragraphs_json(data: &[u8]) -> Result<String>Die Absätze eines Word-Dokuments als JSON: Index, Formatvorlage, Text und ob sich jeder in einer Tabelle befindet.
Auf nexpdf_sdk · Modul conversion · C nexpdf_docx_paragraphs_json
docx_paragraphs_json_value
pub fn docx_paragraphs_json_value(data: &[u8]) -> Result<serde_json::Value>Die Absätze eines Word-Dokuments als JSON: Index, Formatvorlage, Text und ob sich jeder in einer Tabelle befindet.
Auf nexpdf_sdk · Modul conversion · C nexpdf_docx_paragraphs_json
Strukturierte Extraktion und Barcodes
extract_tables_json
pub fn extract_tables_json( &self, page_index: i32, options_json: impl StrArg, ) -> Result<String>Tabellen mit und ohne Linien einer Seite (jede Seite, wenn der Index negativ ist) mit Zellen, Spannen, CSV und Markdown. Optionen {"ruled","unruled","min_unruled_lines"}.
Auf Document · Modul conversion · C nexpdf_extract_tables_json
extract_tables_json_value
pub fn extract_tables_json_value( &self, page_index: i32, options_json: impl StrArg, ) -> Result<serde_json::Value>Tabellen mit und ohne Linien einer Seite (jede Seite, wenn der Index negativ ist) mit Zellen, Spannen, CSV und Markdown. Optionen {"ruled","unruled","min_unruled_lines"}.
Auf Document · Modul conversion · C nexpdf_extract_tables_json
extract_key_values_json
pub fn extract_key_values_json(&self, options_json: impl StrArg) -> Result<String>Label-Wert-Paare aus dem Layout und typisierte Entitäten (Datumsangaben, Beträge, IBANs, E-Mail-Adressen, Telefonnummern, USt-IdNrn.) mit normalisierten Werten. Optionen {"pages","date_order"}.
Auf Document · Modul conversion · C nexpdf_extract_key_values_json
extract_key_values_json_value
pub fn extract_key_values_json_value( &self, options_json: impl StrArg, ) -> Result<serde_json::Value>Label-Wert-Paare aus dem Layout und typisierte Entitäten (Datumsangaben, Beträge, IBANs, E-Mail-Adressen, Telefonnummern, USt-IdNrn.) mit normalisierten Werten. Optionen {"pages","date_order"}.
Auf Document · Modul conversion · C nexpdf_extract_key_values_json
extraction_prompt_json
pub fn extraction_prompt_json( &self, schema_json: impl StrArg, options_json: impl StrArg, ) -> Result<String>Ein Prompt (system, prompt, response_schema) zum Extrahieren eines JSON-Schemas mit dem Sprachmodell Ihrer Wahl. Die Engine führt keine Netzwerkaufrufe aus.
Auf Document · Modul conversion · C nexpdf_extraction_prompt_json
extraction_prompt_json_value
pub fn extraction_prompt_json_value( &self, schema_json: impl StrArg, options_json: impl StrArg, ) -> Result<serde_json::Value>Ein Prompt (system, prompt, response_schema) zum Extrahieren eines JSON-Schemas mit dem Sprachmodell Ihrer Wahl. Die Engine führt keine Netzwerkaufrufe aus.
Auf Document · Modul conversion · C nexpdf_extraction_prompt_json
extraction_validate_json
pub fn extraction_validate_json( &self, schema_json: impl StrArg, answer_json: impl StrArg, ) -> Result<String>Validiert eine Modellantwort anhand des Schemas, wandelt ihre Werte in die passenden Typen um und verankert jeden Wert auf den Seiten: valid, value, errors, warnings, fields.
Auf Document · Modul conversion · C nexpdf_extraction_validate_json
extraction_validate_json_value
pub fn extraction_validate_json_value( &self, schema_json: impl StrArg, answer_json: impl StrArg, ) -> Result<serde_json::Value>Validiert eine Modellantwort anhand des Schemas, wandelt ihre Werte in die passenden Typen um und verankert jeden Wert auf den Seiten: valid, value, errors, warnings, fields.
Auf Document · Modul conversion · C nexpdf_extraction_validate_json
classify_document_json
pub fn classify_document_json(&self, labels_json: impl StrArg) -> Result<String>Klassifiziert das Dokument anhand von Schlüsselwörtern in eines der angegebenen Labels, mit Scores und einem Prompt für die LLM-Klassifizierung.
Auf Document · Modul conversion · C nexpdf_classify_document_json
classify_document_json_value
pub fn classify_document_json_value( &self, labels_json: impl StrArg, ) -> Result<serde_json::Value>Klassifiziert das Dokument anhand von Schlüsselwörtern in eines der angegebenen Labels, mit Scores und einem Prompt für die LLM-Klassifizierung.
Auf Document · Modul conversion · C nexpdf_classify_document_json
read_barcodes_json
pub fn read_barcodes_json(&self, page_index: i32, options_json: impl StrArg) -> Result<String>Liest die Barcodes einer Seite (jede Seite, wenn der Index negativ ist): QR, Data Matrix, Aztec, PDF417, Code 128/39/93, EAN/UPC, ITF, Codabar und mehr, mit Positionen in PDF-Punkten.
Auf Document · Modul conversion · C nexpdf_read_barcodes_json
read_barcodes_json_value
pub fn read_barcodes_json_value( &self, page_index: i32, options_json: impl StrArg, ) -> Result<serde_json::Value>Liest die Barcodes einer Seite (jede Seite, wenn der Index negativ ist): QR, Data Matrix, Aztec, PDF417, Code 128/39/93, EAN/UPC, ITF, Codabar und mehr, mit Positionen in PDF-Punkten.
Auf Document · Modul conversion · C nexpdf_read_barcodes_json
read_barcodes_image_json
pub fn read_barcodes_image_json(data: &[u8], options_json: impl StrArg) -> Result<String>Liest die Barcodes eines PNG- oder JPEG-Bilds, mit Positionen in Pixeln.
Auf nexpdf_sdk · Modul conversion · C nexpdf_read_barcodes_image_json
read_barcodes_image_json_value
pub fn read_barcodes_image_json_value( data: &[u8], options_json: impl StrArg, ) -> Result<serde_json::Value>Liest die Barcodes eines PNG- oder JPEG-Bilds, mit Positionen in Pixeln.
Auf nexpdf_sdk · Modul conversion · C nexpdf_read_barcodes_image_json
add_barcode
pub fn add_barcode( &mut self, page_index: usize, llx: f64, lly: f64, urx: f64, ury: f64, format: impl StrArg, text: impl StrArg, ) -> Result<i32>Zeichnet Text als Vektor-Barcode (weißer Hintergrund, Ruhezone) in ein Rechteck einer Seite, in PDF-Punkten.
Auf Document · Modul editor · C nexpdf_add_barcode
add_barcode_ex
pub fn add_barcode_ex( &mut self, page_index: usize, llx: f64, lly: f64, urx: f64, ury: f64, format: impl StrArg, text: impl StrArg, options_json: impl StrArg, ) -> Result<i32>Zeichnet einen Vektor-Barcode mit den Optionen {"human_readable":"auto"|"always"|"never","quiet_zone","background","color"}; auto druckt die Ziffern unter EAN- und UPC-Codes.
Auf Document · Modul editor · C nexpdf_add_barcode_ex
Annotationen
add_annotation
pub fn add_annotation( &mut self, page_index: usize, kind: impl StrArg, color_hex: impl StrArg, opacity: f64, contents: impl StrArg, llx: f64, lly: f64, urx: f64, ury: f64, ) -> Result<i32>Fügt eine Annotation hinzu. kind ist ein PDF-Annotationssubtyp wie Highlight, Underline, StrikeOut, Squiggly, Square, Circle, FreeText oder Text; Textmarkierungen werden an die Zeilen unter dem Rechteck angepasst. Die Farbe ist #RRGGBB, das Rechteck in PDF-Punkten.
Auf Document · Modul annotations · C nexpdf_add_annotation
add_ink
pub fn add_ink( &mut self, page_index: usize, color_hex: impl StrArg, stroke_width: f64, opacity: f64, coords: impl StrArg, ) -> Result<i32>Fügt eine Freihand-Annotation (Ink) hinzu. coords ist "x,y;x,y;..." in PDF-Punkten.
Auf Document · Modul annotations · C nexpdf_add_ink
add_line
pub fn add_line( &mut self, page_index: usize, kind: impl StrArg, color_hex: impl StrArg, opacity: f64, stroke_width: f64, x1: f64, y1: f64, x2: f64, y2: f64, ) -> Result<i32>Fügt eine Linie oder einen Pfeil hinzu (kind ist Line oder Arrow), von (x1, y1) nach (x2, y2) in PDF-Punkten.
Auf Document · Modul annotations · C nexpdf_add_line
annotations_json
pub fn annotations_json(&self, page_index: usize) -> Result<String>Die Annotationen einer Seite als JSON: num, gen, kind, color, contents und das Rechteck.
Auf Document · immer verfügbar · C nexpdf_annotations_json
annotations_json_value
pub fn annotations_json_value(&self, page_index: usize) -> Result<serde_json::Value>Die Annotationen einer Seite als JSON: num, gen, kind, color, contents und das Rechteck.
Auf Document · immer verfügbar · C nexpdf_annotations_json
remove_annotation
pub fn remove_annotation( &mut self, page_index: usize, num: u32, generation: u16, ) -> Result<i32>Entfernt die Annotation mit der Objektnummer num und der Generation gen von einer Seite.
Auf Document · Modul annotations · C nexpdf_remove_annotation
move_annotation
pub fn move_annotation(&mut self, num: u32, generation: u16, dx: f64, dy: f64) -> Result<i32>Verschiebt eine Annotation um (dx, dy) PDF-Punkte.
Auf Document · Modul annotations · C nexpdf_move_annotation
set_annotation_contents
pub fn set_annotation_contents( &mut self, num: u32, generation: u16, contents: impl StrArg, ) -> Result<i32>Ersetzt den Textinhalt einer Annotation.
Auf Document · Modul annotations · C nexpdf_set_annotation_contents
export_xfdf
pub fn export_xfdf(&self) -> Result<String>Exportiert jede Annotation als XFDF-Dokument.
Auf Document · Modul annotations · C nexpdf_export_xfdf
import_xfdf
pub fn import_xfdf(&mut self, xfdf: impl StrArg) -> Result<i32>Importiert Annotationen aus einem XFDF-Dokument.
Auf Document · Modul annotations · C nexpdf_import_xfdf
flatten_annotations
pub fn flatten_annotations(&mut self, page_index: i32) -> Result<i32>Brennt Annotationen in den Seiteninhalt ein. Ein negativer Seitenindex verflacht jede Seite.
Auf Document · Modul annotations · C nexpdf_flatten_annotations
add_image_stamp
pub fn add_image_stamp( &mut self, page: usize, llx: f64, lly: f64, urx: f64, ury: f64, rgba: &[u8], width: u32, height: u32, opacity: f64, ) -> Result<i32>Fügt eine Bildstempel-Annotation aus RGBA-Pixeln hinzu (Transparenz bleibt erhalten). 1 bei Erfolg.
Auf Document · Modul annotations · C nexpdf_add_image_stamp
add_measurement
pub fn add_measurement(&mut self, page: usize, json: impl StrArg) -> Result<String>Speichert eine Messung: {"kind":"distance|perimeter|area","points":[[x,y],...],"unit":"mm","per_point":0.3528,"label":"1:100","color":"#2f54d6"}. Gibt {"num","gen","value","text"} zurück.
Auf Document · Modul annotations · C nexpdf_add_measurement
measurements_json
pub fn measurements_json(&self) -> Result<String>Die gespeicherten Messungen als JSON.
Auf Document · immer verfügbar · C nexpdf_measurements_json
measurements_json_value
pub fn measurements_json_value(&self) -> Result<serde_json::Value>Die gespeicherten Messungen als JSON.
Auf Document · immer verfügbar · C nexpdf_measurements_json
add_file_attachment_annot
pub fn add_file_attachment_annot( &mut self, page_index: usize, x: f64, y: f64, name: impl StrArg, data: &[u8], mime: impl StrArg, description: impl StrArg, ) -> Result<i32>Fügt eine Büroklammer-Annotation hinzu, die eine Datei trägt; (x, y) ist die obere linke Ecke des Symbols in PDF-Punkten.
Auf Document · Modul annotations · C nexpdf_add_file_attachment_annot
add_ink_signature
pub fn add_ink_signature( &mut self, page_index: usize, color_hex: impl StrArg, stroke_width: f64, strokes: impl StrArg, ) -> Result<i32>Fügt eine handschriftliche Signatur hinzu: eine Freihand-Annotation mit mehreren Strichen ("x,y;x,y|x,y;x,y", PDF-Punkte) und dem Betreff „Signature“. Nur visuell; für eine kryptografische Signatur verwenden Sie eine PAdES-Signatur.
Auf Document · Modul annotations · C nexpdf_add_ink_signature
reply_to_annotation
pub fn reply_to_annotation( &mut self, page_index: usize, num: u32, generation: u16, author: impl StrArg, text: impl StrArg, ) -> Result<i32>Fügt eine Antwort von author zu einer Annotation (oder zu einer anderen Antwort) hinzu. Gibt die Objektnummer der Antwort zurück (Generation 0).
Auf Document · Modul annotations · C nexpdf_reply_to_annotation
annotation_replies_json
pub fn annotation_replies_json( &self, page_index: usize, num: u32, generation: u16, ) -> Result<String>Der Thread unter einer Annotation, die älteste zuerst: num, gen, in_reply_to, author, date, text, state, state_model.
Auf Document · Modul annotations · C nexpdf_annotation_replies_json
annotation_replies_json_value
pub fn annotation_replies_json_value( &self, page_index: usize, num: u32, generation: u16, ) -> Result<serde_json::Value>Der Thread unter einer Annotation, die älteste zuerst: num, gen, in_reply_to, author, date, text, state, state_model.
Auf Document · Modul annotations · C nexpdf_annotation_replies_json
set_annotation_state
pub fn set_annotation_state( &mut self, page_index: usize, num: u32, generation: u16, author: impl StrArg, state: impl StrArg, ) -> Result<i32>Setzt einen Review-Status (Accepted, Rejected, Cancelled, Completed, None) oder markierten Status (Marked, Unmarked) als verborgene Status-Antwort. Gibt ihre Objektnummer zurück.
Auf Document · Modul annotations · C nexpdf_set_annotation_state
Formulare
form_fields_json
pub fn form_fields_json(&self) -> Result<String>Die Formularfelder als JSON: name, kind, value, page, Rechteck, read_only und required.
Auf Document · Modul forms · C nexpdf_form_fields_json
form_fields_json_value
pub fn form_fields_json_value(&self) -> Result<serde_json::Value>Die Formularfelder als JSON: name, kind, value, page, Rechteck, read_only und required.
Auf Document · Modul forms · C nexpdf_form_fields_json
fill_form_field
pub fn fill_form_field(&mut self, name: impl StrArg, value: impl StrArg) -> Result<i32>Setzt einen Feldwert wie ein Viewer: Die Keystroke- und Validate-Skripte prüfen den Wert, danach wird jedes berechnete Feld neu berechnet. Kontrollkästchen nehmen "true" oder "false", Listenfelder den Optionstext.
Auf Document · Modul forms · C nexpdf_fill_form_field
set_signature_appearance
pub fn set_signature_appearance( &mut self, name: impl StrArg, rgba: &[u8], width: u32, height: u32, ) -> Result<i32>Zeigt eine gezeichnete, getippte oder gescannte Signatur (RGBA-Pixel) in einem Signaturfeld an, ohne digital zu signieren; skaliert passend für jedes Widget und zentriert. Eine spätere digitale Signatur ersetzt sie.
Auf Document · Modul forms · C nexpdf_set_signature_appearance
add_form_field
pub fn add_form_field( &mut self, page_index: usize, kind: impl StrArg, name: impl StrArg, llx: f64, lly: f64, urx: f64, ury: f64, ) -> Result<i32>Fügt ein Formularfeld namens name in einem Rechteck einer Seite hinzu. kind: text (Standard), checkbox, radio, combobox, listbox, button, signature oder barcode.
Auf Document · Modul forms · C nexpdf_add_form_field
flatten_forms
pub fn flatten_forms(&mut self) -> Result<i32>Brennt die Formularfelder in den Seiteninhalt ein.
Auf Document · Modul forms · C nexpdf_flatten_forms
recalculate_forms
pub fn recalculate_forms(&mut self) -> Result<i32>Führt jedes Berechnungsskript aus; gibt zurück, wie viele Felder sich geändert haben.
Auf Document · Modul forms · C nexpdf_recalculate_forms
export_form_json
pub fn export_form_json(&self) -> Result<String>Die Feldwerte als JSON-Objekt.
Auf Document · Modul forms · C nexpdf_export_form_json
export_form_json_value
pub fn export_form_json_value(&self) -> Result<serde_json::Value>Die Feldwerte als JSON-Objekt.
Auf Document · Modul forms · C nexpdf_export_form_json
import_form_json
pub fn import_form_json(&mut self, json: impl StrArg) -> Result<i32>Füllt Felder aus einem JSON-Objekt mit Namen und Werten.
Auf Document · Modul forms · C nexpdf_import_form_json
export_form_fdf
pub fn export_form_fdf(&self, pdf_name: impl StrArg) -> Result<Vec<u8>>Die Feldwerte als FDF-Datei; pdf_name ist der darin festgehaltene Dateiname.
Auf Document · Modul forms · C nexpdf_export_form_fdf
import_form_fdf
pub fn import_form_fdf(&mut self, data: &[u8]) -> Result<i32>Füllt Felder aus einer FDF-Datei.
Auf Document · Modul forms · C nexpdf_import_form_fdf
export_form_xfdf
pub fn export_form_xfdf(&self, pdf_name: impl StrArg) -> Result<String>Die Feldwerte als XFDF.
Auf Document · Modul forms · C nexpdf_export_form_xfdf
import_form_xfdf
pub fn import_form_xfdf(&mut self, xfdf: impl StrArg) -> Result<i32>Füllt Felder aus XFDF.
Auf Document · Modul forms · C nexpdf_import_form_xfdf
XFA-Formulare
xfa_info_json
pub fn xfa_info_json(&self) -> Result<String>Ob das Dokument XFA hat, ob es dynamisch ist, Feld- und Datenanzahlen und die XDP-Pakete.
Auf Document · Modul forms · C nexpdf_xfa_info_json
xfa_info_json_value
pub fn xfa_info_json_value(&self) -> Result<serde_json::Value>Ob das Dokument XFA hat, ob es dynamisch ist, Feld- und Datenanzahlen und die XDP-Pakete.
Auf Document · Modul forms · C nexpdf_xfa_info_json
xfa_export_data
pub fn xfa_export_data(&self, format: impl StrArg) -> Result<String>Die XFA-Daten als xml (Standard) oder flaches json ({"path":"value"}). Schlägt fehl, wenn das Dokument kein XFA hat.
Auf Document · Modul forms · C nexpdf_xfa_export_data
xfa_import_data
pub fn xfa_import_data(&mut self, data: impl StrArg, format: impl StrArg) -> Result<i32>Importiert XFA-Daten: XML ersetzt die Daten, JSON setzt die angegebenen Werte. Bei statischen Formularen werden die AcroForm-Felder aktualisiert. Gibt die Anzahl der importierten Werte zurück.
Auf Document · Modul forms · C nexpdf_xfa_import_data
xfa_to_acroform
pub fn xfa_to_acroform(&mut self) -> Result<i32>Konvertiert in ein einfaches AcroForm-PDF und entfernt XFA; dynamische Formulare werden zu neuen Seiten gelayoutet, und Skripte laufen zuerst. Textfelder behalten ihren formatierten Anzeigewert als /V. Gibt die Anzahl der AcroForm-Felder zurück.
Auf Document · Modul forms · C nexpdf_xfa_to_acroform
xfa_flatten
pub fn xfa_flatten(&mut self) -> Result<i32>Konvertiert und verflacht das XFA-Formular: ein einfaches PDF mit gezeichneten Werten. Gibt die Anzahl der verflachten Widgets zurück.
Auf Document · Modul forms · C nexpdf_xfa_flatten
xfa_remove
pub fn xfa_remove(&mut self) -> Result<i32>Entfernt XFA und behält die AcroForm-Felder und Seiten: 1 entfernt, 0 kein XFA.
Auf Document · Modul forms · C nexpdf_xfa_remove
xfa_to_acroform_json
pub fn xfa_to_acroform_json(&mut self, options_json: impl StrArg) -> Result<String>Konvertiert mit den Optionen {"scripts":true,"flatten":false} in AcroForm und gibt einen Bericht zurück: flattened, fields, pages, warnings und validation_errors (som, test, severity, message).
Auf Document · Modul forms · C nexpdf_xfa_to_acroform_json
xfa_to_acroform_json_value
pub fn xfa_to_acroform_json_value( &mut self, options_json: impl StrArg, ) -> Result<serde_json::Value>Konvertiert mit den Optionen {"scripts":true,"flatten":false} in AcroForm und gibt einen Bericht zurück: flattened, fields, pages, warnings und validation_errors (som, test, severity, message).
Auf Document · Modul forms · C nexpdf_xfa_to_acroform_json
xfa_run_scripts_json
pub fn xfa_run_scripts_json(&mut self) -> Result<String>Führt die Skripte initialize, calculate und validate (FormCalc und JavaScript) aus und speichert berechnete Werte in den Daten: data_changed, warnings, validation_errors.
Auf Document · Modul forms · C nexpdf_xfa_run_scripts_json
xfa_run_scripts_json_value
pub fn xfa_run_scripts_json_value(&mut self) -> Result<serde_json::Value>Führt die Skripte initialize, calculate und validate (FormCalc und JavaScript) aus und speichert berechnete Werte in den Daten: data_changed, warnings, validation_errors.
Auf Document · Modul forms · C nexpdf_xfa_run_scripts_json
register_fallback_font
pub fn register_fallback_font(data: &[u8]) -> Result<i32>Registriert eine TrueType-/OpenType-Schrift (oder .ttc) für Text, den die mitgelieferten Schriften nicht darstellen können (CJK, Arabisch und mehr), wenn XFA-Formulare gelayoutet werden; die Daten werden kopiert. 1 oder -1.
Auf nexpdf_sdk · Modul forms · C nexpdf_register_fallback_font
Zusammenarbeit in Echtzeit
sync_export_json
pub fn sync_export_json(&mut self, since_version: u64) -> Result<String>NexPDF Sync: jede Änderung (von jedem Client) mit einer Lamport-Uhr über since_version, als Änderungssatz nexpdf-sync/1.
Auf Document · Modul annotations · C nexpdf_sync_export_json
sync_export_json_value
pub fn sync_export_json_value(&mut self, since_version: u64) -> Result<serde_json::Value>NexPDF Sync: jede Änderung (von jedem Client) mit einer Lamport-Uhr über since_version, als Änderungssatz nexpdf-sync/1.
Auf Document · Modul annotations · C nexpdf_sync_export_json
sync_export_local_json
pub fn sync_export_local_json(&mut self, since_version: u64) -> Result<String>NexPDF Sync: nur die eigenen Änderungen dieser Kopie über since_version (was ein Client überträgt); behalten Sie die zurückgegebene clock für den nächsten Aufruf.
Auf Document · Modul annotations · C nexpdf_sync_export_local_json
sync_export_local_json_value
pub fn sync_export_local_json_value( &mut self, since_version: u64, ) -> Result<serde_json::Value>NexPDF Sync: nur die eigenen Änderungen dieser Kopie über since_version (was ein Client überträgt); behalten Sie die zurückgegebene clock für den nächsten Aufruf.
Auf Document · Modul annotations · C nexpdf_sync_export_local_json
sync_apply_json
pub fn sync_apply_json(&mut self, changes_json: impl StrArg) -> Result<String>NexPDF Sync: wendet entfernte Änderungen an, Last Writer Wins pro Record. Gibt ok, clock, applied, ignored, conflicts und errors zurück.
Auf Document · Modul annotations · C nexpdf_sync_apply_json
sync_apply_json_value
pub fn sync_apply_json_value( &mut self, changes_json: impl StrArg, ) -> Result<serde_json::Value>NexPDF Sync: wendet entfernte Änderungen an, Last Writer Wins pro Record. Gibt ok, clock, applied, ignored, conflicts und errors zurück.
Auf Document · Modul annotations · C nexpdf_sync_apply_json
sync_snapshot_json
pub fn sync_snapshot_json(&mut self) -> Result<String>NexPDF Sync: jeder Record mit seiner Version, einschließlich Basis-Records und Tombstones.
Auf Document · Modul annotations · C nexpdf_sync_snapshot_json
sync_snapshot_json_value
pub fn sync_snapshot_json_value(&mut self) -> Result<serde_json::Value>NexPDF Sync: jeder Record mit seiner Version, einschließlich Basis-Records und Tombstones.
Auf Document · Modul annotations · C nexpdf_sync_snapshot_json
sync_set_client_id
pub fn sync_set_client_id(&mut self, client_id: impl StrArg) -> Result<i32>NexPDF Sync: die Client-ID, unter der diese Kopie ihre Änderungen versioniert (1 bis 64 Zeichen aus [A-Za-z0-9-_.:@]).
Auf Document · Modul annotations · C nexpdf_sync_set_client_id
Seitenbearbeitung
rotate_page
pub fn rotate_page(&mut self, page_index: usize, degrees: i32) -> Result<i32>Dreht eine Seite um ein Vielfaches von 90 Grad.
Auf Document · Modul editor · C nexpdf_rotate_page
delete_page
pub fn delete_page(&mut self, page_index: usize) -> Result<i32>Löscht eine Seite.
Auf Document · Modul editor · C nexpdf_delete_page
duplicate_page
pub fn duplicate_page(&mut self, page_index: usize) -> Result<i32>Fügt eine Kopie einer Seite nach ihr ein.
Auf Document · Modul editor · C nexpdf_duplicate_page
add_blank_page
pub fn add_blank_page(&mut self) -> Result<i32>Hängt eine leere Seite an.
Auf Document · Modul editor · C nexpdf_add_blank_page
reverse_pages
pub fn reverse_pages(&mut self) -> Result<i32>Kehrt die Seitenreihenfolge um.
Auf Document · Modul editor · C nexpdf_reverse_pages
move_page
pub fn move_page(&mut self, from: usize, to: usize) -> Result<i32>Verschiebt die Seite bei from an den Index to.
Auf Document · Modul editor · C nexpdf_move_page
crop_page
pub fn crop_page( &mut self, page_index: usize, llx: f64, lly: f64, urx: f64, ury: f64, ) -> Result<i32>Setzt den Beschnittrahmen (Crop Box) einer Seite (PDF-Punkte).
Auf Document · Modul editor · C nexpdf_crop_page
extract_pages
pub fn extract_pages(&self, indices: &[u32]) -> Result<Document>Ein neues Dokument aus den angegebenen Seiten (Teilen).
Auf Document · Modul editor · C nexpdf_extract_pages
append_document
pub fn append_document(&mut self, other: &Document) -> Result<i32>Hängt die Seiten eines anderen Dokuments an (Zusammenführen).
Auf Document · Modul editor · C nexpdf_append_document
insert_image_pages
pub fn insert_image_pages(&mut self, index: usize, data: &[u8]) -> Result<i32>Fügt die Bilder einer JPEG-, PNG- oder TIFF-Datei als Seiten vor index ein (begrenzt; die Seitenzahl hängt an). Gibt die Anzahl der hinzugefügten Seiten zurück.
Auf Document · immer verfügbar · C nexpdf_insert_image_pages
set_page_background
pub fn set_page_background( &mut self, options_json: impl StrArg, rgb: &[u8], width: u32, height: u32, ) -> Result<i32>Setzt einen Seitenhintergrund: eine Farbe und/oder ein RGB-Bild. Optionen: {"color":"#fbf4e2","fit":"cover|stretch|center","scale":1,"opacity":1,"pages":[]}. Gibt die geänderten Seiten zurück.
Auf Document · Modul editor · C nexpdf_set_page_background
remove_page_background
pub fn remove_page_background(&mut self, pages_json: impl StrArg) -> Result<i32>Entfernt NexPDF-Hintergründe von den Seiten in pages_json ("[0,2]") oder von jeder Seite.
Auf Document · Modul editor · C nexpdf_remove_page_background
Inhaltsbearbeitung
page_content_json
pub fn page_content_json(&self, page: usize) -> Result<String>Die Textzeilen und Bilder einer Seite als JSON: id, kind (text oder image), text, rect, size, color, font, family, bold, italic. IDs bleiben bis zur nächsten Bearbeitung dieser Seite gültig.
Auf Document · Modul editor · C nexpdf_page_content_json
page_content_json_value
pub fn page_content_json_value(&self, page: usize) -> Result<serde_json::Value>Die Textzeilen und Bilder einer Seite als JSON: id, kind (text oder image), text, rect, size, color, font, family, bold, italic. IDs bleiben bis zur nächsten Bearbeitung dieser Seite gültig.
Auf Document · Modul editor · C nexpdf_page_content_json
edit_text
pub fn edit_text( &mut self, page: usize, id: impl StrArg, change_json: impl StrArg, ) -> Result<i32>Bearbeitet eine Textzeile: {text?, size?, color?, dx?, dy?, family?, bold?, italic?}. Leerer Text löscht sie.
Auf Document · Modul editor · C nexpdf_edit_text
add_page_text
pub fn add_page_text(&mut self, page: usize, json: impl StrArg) -> Result<i32>Fügt bearbeitbaren Seitentext hinzu: {text, x, y (baseline), size, color, family, bold, italic}.
Auf Document · Modul editor · C nexpdf_add_page_text
delete_content
pub fn delete_content(&mut self, page: usize, id: impl StrArg) -> Result<i32>Löscht eine Textzeile oder ein Bild des Seiteninhalts.
Auf Document · Modul editor · C nexpdf_delete_content
transform_image
pub fn transform_image( &mut self, page: usize, id: impl StrArg, llx: f64, lly: f64, urx: f64, ury: f64, ) -> Result<i32>Verschiebt ein Bild oder ändert seine Größe auf ein Rechteck (PDF-Punkte).
Auf Document · Modul editor · C nexpdf_transform_image
replace_image
pub fn replace_image( &mut self, page: usize, id: impl StrArg, rgb: &[u8], width: u32, height: u32, ) -> Result<i32>Ersetzt ein Bild durch RGB-Pixel (Breite x Höhe x 3 Bytes).
Auf Document · Modul editor · C nexpdf_replace_image
edit_text_block
pub fn edit_text_block( &mut self, page_index: usize, text: impl StrArg, color_hex: impl StrArg, font_size: f64, bold: i32, italic: i32, replace_existing: i32, llx: f64, lly: f64, urx: f64, ury: f64, ) -> Result<i32>Schreibt einen Textblock in ein Rechteck mit Farbe, Größe und Stil und ersetzt optional den dort bereits vorhandenen Text.
Auf Document · Modul editor · C nexpdf_edit_text_block
Metadaten, Lesezeichen, Ebenen und Anhänge
metadata_json
pub fn metadata_json(&self) -> Result<String>Die Dokumentinformationen (Titel, Autor, Thema, Schlüsselwörter, ...) als JSON.
Auf Document · immer verfügbar · C nexpdf_metadata_json
metadata_json_value
pub fn metadata_json_value(&self) -> Result<serde_json::Value>Die Dokumentinformationen (Titel, Autor, Thema, Schlüsselwörter, ...) als JSON.
Auf Document · immer verfügbar · C nexpdf_metadata_json
set_metadata
pub fn set_metadata( &mut self, title: impl StrArg, author: impl StrArg, subject: impl StrArg, keywords: impl StrArg, ) -> Result<i32>Setzt Titel, Autor, Thema und Schlüsselwörter. Ausgelassene Werte (null) behalten den aktuellen.
Auf Document · Modul editor · C nexpdf_set_metadata
outlines_json
pub fn outlines_json(&self) -> Result<String>Die Lesezeichen als JSON: [{"title","page","children":[...]}].
Auf Document · immer verfügbar · C nexpdf_outlines_json
outlines_json_value
pub fn outlines_json_value(&self) -> Result<serde_json::Value>Die Lesezeichen als JSON: [{"title","page","children":[...]}].
Auf Document · immer verfügbar · C nexpdf_outlines_json
set_outlines_json
pub fn set_outlines_json(&mut self, json: impl StrArg) -> Result<i32>Ersetzt die Lesezeichen durch einen JSON-Baum in derselben Form.
Auf Document · Modul editor · C nexpdf_set_outlines_json
page_labels_json
pub fn page_labels_json(&self) -> Result<String>Seitenbezeichnungen: {"labels":["i","ii","1"],"ranges":[{"start":0,"style":"roman","prefix":"","first":1}]}.
Auf Document · immer verfügbar · C nexpdf_page_labels_json
page_labels_json_value
pub fn page_labels_json_value(&self) -> Result<serde_json::Value>Seitenbezeichnungen: {"labels":["i","ii","1"],"ranges":[{"start":0,"style":"roman","prefix":"","first":1}]}.
Auf Document · immer verfügbar · C nexpdf_page_labels_json
set_page_labels_json
pub fn set_page_labels_json(&mut self, json: impl StrArg) -> Result<i32>Setzt die Bereiche der Seitenbezeichnungen ([] entfernt die Bezeichnungen). Stile: decimal, roman, ROMAN, letters, LETTERS, none.
Auf Document · Modul editor · C nexpdf_set_page_labels_json
layers_json
pub fn layers_json(&self) -> Result<String>Die optionalen Inhaltsgruppen (Ebenen): [{"num","gen","name","visible","printable"}].
Auf Document · immer verfügbar · C nexpdf_layers_json
layers_json_value
pub fn layers_json_value(&self) -> Result<serde_json::Value>Die optionalen Inhaltsgruppen (Ebenen): [{"num","gen","name","visible","printable"}].
Auf Document · immer verfügbar · C nexpdf_layers_json
set_layer_visible
pub fn set_layer_visible(&mut self, num: u32, generation: u16, visible: i32) -> Result<i32>Zeigt oder verbirgt eine Ebene.
Auf Document · immer verfügbar · C nexpdf_set_layer_visible
attachments_json
pub fn attachments_json(&self) -> Result<String>Die eingebetteten Dateien: [{"name","description","mime","size","page"}]; page ist null bei Dateien auf Dokumentebene.
Auf Document · immer verfügbar · C nexpdf_attachments_json
attachments_json_value
pub fn attachments_json_value(&self) -> Result<serde_json::Value>Die eingebetteten Dateien: [{"name","description","mime","size","page"}]; page ist null bei Dateien auf Dokumentebene.
Auf Document · immer verfügbar · C nexpdf_attachments_json
attachment_data
pub fn attachment_data(&self, name: impl StrArg) -> Result<Vec<u8>>Die Bytes einer eingebetteten Datei.
Auf Document · immer verfügbar · C nexpdf_attachment_data
add_attachment
pub fn add_attachment( &mut self, name: impl StrArg, data: &[u8], mime: impl StrArg, description: impl StrArg, ) -> Result<i32>Bettet eine Datei auf Dokumentebene ein.
Auf Document · Modul editor · C nexpdf_add_attachment
remove_attachment
pub fn remove_attachment(&mut self, name: impl StrArg) -> Result<i32>Entfernt eine eingebettete Datei.
Auf Document · Modul editor · C nexpdf_remove_attachment
Verschlüsselung, Wasserzeichen und Stempel
encrypt_aes256
pub fn encrypt_aes256(&mut self, user_pw: impl StrArg, owner_pw: impl StrArg) -> Result<i32>Verschlüsselt mit AES-256 mit einem Benutzerpasswort (zum Öffnen) und einem Besitzerpasswort.
Auf Document · Modul security · C nexpdf_encrypt_aes256
encrypt_with_permissions
pub fn encrypt_with_permissions( &mut self, user_pw: impl StrArg, owner_pw: impl StrArg, permissions: u32, ) -> Result<i32>Verschlüsselt mit AES-256 und einer Berechtigungsmaske: Drucken 1, Ändern 2, Kopieren 4, Annotieren 8, Formulare ausfüllen 16, Zusammenstellen 32.
Auf Document · Modul security · C nexpdf_encrypt_with_permissions
security_json
pub fn security_json(&self) -> Result<String>Der Verschlüsselungszustand: {"encrypted","revision","owner","print","modify","copy","annotate","fill_forms","assemble"}.
Auf Document · immer verfügbar · C nexpdf_security_json
security_json_value
pub fn security_json_value(&self) -> Result<serde_json::Value>Der Verschlüsselungszustand: {"encrypted","revision","owner","print","modify","copy","annotate","fill_forms","assemble"}.
Auf Document · immer verfügbar · C nexpdf_security_json
remove_password
pub fn remove_password(&mut self, password: impl StrArg) -> Result<i32>Entfernt den Schutz. Braucht Besitzerzugriff: Das Dokument wurde mit dem Besitzerpasswort geöffnet, oder übergeben Sie es hier.
Auf Document · Modul security · C nexpdf_remove_password
add_watermark
pub fn add_watermark(&mut self, text: impl StrArg) -> Result<i32>Bringt auf jeder Seite ein Text-Wasserzeichen an.
Auf Document · Modul security · C nexpdf_add_watermark
remove_watermarks
pub fn remove_watermarks(&mut self) -> Result<i32>Entfernt die von NexPDF hinzugefügten Wasserzeichen.
Auf Document · Modul security · C nexpdf_remove_watermarks
add_header_footer
pub fn add_header_footer( &mut self, header: impl StrArg, footer: impl StrArg, font_size: f64, ) -> Result<i32>Fügt jeder Seite eine Kopf- und/oder Fußzeile hinzu. {page} und {total} werden ersetzt; eine Schriftgröße von 0 oder weniger verwendet den Standard.
Auf Document · Modul security · C nexpdf_add_header_footer
add_bates
pub fn add_bates(&mut self, prefix: impl StrArg, start: u64, digits: u32) -> Result<i32>Fügt eine Bates-Nummerierung hinzu: prefix, erste Nummer und Anzahl der Ziffern.
Auf Document · Modul security · C nexpdf_add_bates
Schwärzung
apply_redaction
pub fn apply_redaction( &mut self, page_index: usize, llx: f64, lly: f64, urx: f64, ury: f64, fill_white: i32, ) -> Result<i32>Entfernt Text, Bilder und Annotationen unter einem Rechteck dauerhaft und malt ein deckendes Feld darüber, schwarz oder weiß.
Auf Document · Modul redaction · C nexpdf_apply_redaction
redact_matches
pub fn redact_matches( &mut self, query: impl StrArg, mode: i32, fill_white: i32, ) -> Result<i32>Findet und schwärzt jeden Treffer dauerhaft. mode: 0 = Text, 1 = regulärer Ausdruck, 2 = Muster-ID (email, phone, credit-card, iban, pt-nif, us-ssn, ipv4, url, date). Gibt die Anzahl der geschwärzten Bereiche zurück.
Auf Document · Modul redaction · C nexpdf_redact_matches
Digitale Signaturen
sign_pades
pub fn sign_pades( &self, signer: impl StrArg, reason: impl StrArg, location: impl StrArg, ) -> Result<Vec<u8>>Signiert mit einem neuen selbstsignierten Testzertifikat (PAdES B-B) und gibt die signierte Datei zurück. Schreiben Sie die Bytes unverändert: Wird das Dokument erneut gespeichert, wird die Signatur zerstört.
Auf Document · Modul signatures · C nexpdf_sign_pades
sign_pkcs12
pub fn sign_pkcs12( &self, p12: &[u8], password: impl StrArg, options_json: impl StrArg, ) -> Result<Vec<u8>>Signiert mit einer PKCS#12-Identität (.p12/.pfx) und gibt die signierte Datei zurück. Optionen: {"name","reason","location","contact","field","tsa_url","ltv":true,"appearance":{"page":0,"rect":[llx,lly,urx,ury],"ink":"x,y;x,y|...","text":"..."}}. Ohne .p12 wird ein selbstsigniertes Zertifikat erstellt.
Auf Document · Modul signatures · C nexpdf_sign_pkcs12
pkcs12_info_json
pub fn pkcs12_info_json(data: &[u8], password: impl StrArg) -> Result<String>Die Zertifikatszusammenfassung einer PKCS#12-Datei; schlägt bei einem falschen Passwort mit „incorrect password“ fehl.
Auf nexpdf_sdk · Modul signatures · C nexpdf_pkcs12_info_json
pkcs12_info_json_value
pub fn pkcs12_info_json_value(data: &[u8], password: impl StrArg) -> Result<serde_json::Value>Die Zertifikatszusammenfassung einer PKCS#12-Datei; schlägt bei einem falschen Passwort mit „incorrect password“ fehl.
Auf nexpdf_sdk · Modul signatures · C nexpdf_pkcs12_info_json
prepare_external_signature
pub fn prepare_external_signature( &self, cert: &[u8], options_json: impl StrArg, ) -> Result<Vec<u8>>Externes Signieren (HSM, Smartcard, Cloud-KMS), Schritt 1: ein PDF mit einer leeren Signatur für das Signierzertifikat (PEM oder DER, optional gefolgt von seiner Kette). Optionen wie beim PKCS#12-Signieren.
Auf Document · Modul signatures · C nexpdf_prepare_external_signature
external_signature_data
pub fn external_signature_data(prepared: &[u8], cert: &[u8]) -> Result<Vec<u8>>Externes Signieren, Schritt 2: die zu signierenden Bytes (DER-signierte Attribute; bei Geräten, die einen Digest entgegennehmen, deren SHA-256 signieren).
Auf nexpdf_sdk · Modul signatures · C nexpdf_external_signature_data
complete_external_signature
pub fn complete_external_signature( prepared: &[u8], cert: &[u8], signature: &[u8], algorithm: i32, options_json: impl StrArg, ) -> Result<Vec<u8>>Externes Signieren, Schritt 3: bettet die Signatur ein und gibt das signierte PDF zurück. algorithm: 0 RSA PKCS#1 v1.5 SHA-256, 1 ECDSA SHA-256. Optionen: {"tsa_url":"...","ltv":true}.
Auf nexpdf_sdk · Modul signatures · C nexpdf_complete_external_signature
verify_signatures_json
pub fn verify_signatures_json(data: &[u8]) -> Result<String>Verifiziert jede Signatur einer signierten Datei (ihre exakten Bytes). Jeder Eintrag enthält field, signer, subject, digest_ok, signature_ok, covers_whole_document, reason, signing_time, timestamp_ok, chain_ok, trusted, revocation, ltv, level und mehr.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_verify_signatures_json
verify_signatures_json_value
pub fn verify_signatures_json_value(data: &[u8]) -> Result<serde_json::Value>Verifiziert jede Signatur einer signierten Datei (ihre exakten Bytes). Jeder Eintrag enthält field, signer, subject, digest_ok, signature_ok, covers_whole_document, reason, signing_time, timestamp_ok, chain_ok, trusted, revocation, ltv, level und mehr.
Auf nexpdf_sdk · immer verfügbar · C nexpdf_verify_signatures_json
verify_signatures_with_roots_json
pub fn verify_signatures_with_roots_json(data: &[u8], roots_pem: impl StrArg) -> Result<String>Verifiziert die Signaturen und behandelt die PEM-Zertifikate in roots_pem als Vertrauensanker.
Auf nexpdf_sdk · Modul signatures · C nexpdf_verify_signatures_with_roots_json
verify_signatures_with_roots_json_value
pub fn verify_signatures_with_roots_json_value( data: &[u8], roots_pem: impl StrArg, ) -> Result<serde_json::Value>Verifiziert die Signaturen und behandelt die PEM-Zertifikate in roots_pem als Vertrauensanker.
Auf nexpdf_sdk · Modul signatures · C nexpdf_verify_signatures_with_roots_json
add_ltv
pub fn add_ltv(data: &[u8]) -> Result<Vec<u8>>Fügt einer signierten Datei Langzeit-Validierungsdaten hinzu (DSS mit OCSP-Antworten und CRLs).
Auf nexpdf_sdk · Modul signatures · C nexpdf_add_ltv
add_document_timestamp
pub fn add_document_timestamp(&self, options_json: impl StrArg) -> Result<Vec<u8>>Fügt einen RFC-3161-Dokument-Zeitstempel einer TSA hinzu (PAdES B-LTA). Optionen: {"tsa_url" (required),"hash","field","reserved","ltv"}; mit ltv kommen zuerst die Validierungsdaten früherer Signaturen in den DSS. Gibt die neue Datei zurück.
Auf Document · Modul signatures · C nexpdf_add_document_timestamp
add_document_timestamp_bytes
pub fn add_document_timestamp_bytes(data: &[u8], options_json: impl StrArg) -> Result<Vec<u8>>Fügt den Bytes einer PDF-Datei einen Dokument-Zeitstempel hinzu (zum Beispiel direkt aus dem Signieren). Dieselben Optionen. Gibt die neue Datei zurück.
Auf nexpdf_sdk · Modul signatures · C nexpdf_add_document_timestamp_bytes
prepare_document_timestamp
pub fn prepare_document_timestamp(&self, options_json: impl StrArg) -> Result<Vec<u8>>Dokument-Zeitstempel von Ihrer eigenen TSA oder Ihrem HSM, Schritt 1: das PDF mit einem leeren Zeitstempel (Optionen wie beim Hinzufügen eines Zeitstempels, ohne tsa_url).
Auf Document · Modul signatures · C nexpdf_prepare_document_timestamp
document_timestamp_request
pub fn document_timestamp_request(prepared: &[u8], hash: impl StrArg) -> Result<Vec<u8>>Dokument-Zeitstempel, Schritt 2: der DER-TimeStampReq, der als application/timestamp-query an die TSA gesendet wird (Hash standardmäßig SHA-256).
Auf nexpdf_sdk · Modul signatures · C nexpdf_document_timestamp_request
complete_document_timestamp
pub fn complete_document_timestamp(prepared: &[u8], token: &[u8]) -> Result<Vec<u8>>Dokument-Zeitstempel, Schritt 3: das zeitgestempelte PDF, aus der vorbereiteten Datei und dem TSA-Token (TimeStampResp oder TimeStampToken).
Auf nexpdf_sdk · Modul signatures · C nexpdf_complete_document_timestamp
signature_timestamp_request
pub fn signature_timestamp_request(data: &[u8], hash: impl StrArg) -> Result<Vec<u8>>B-T in Schritten: der DER-TimeStampReq über den Wert der letzten Signatur (standardmäßig SHA-256), der als application/timestamp-query per POST an die TSA gesendet wird.
Auf nexpdf_sdk · Modul signatures · C nexpdf_signature_timestamp_request
add_signature_timestamp
pub fn add_signature_timestamp(data: &[u8], token: &[u8]) -> Result<Vec<u8>>B-T in Schritten: speichert die TSA-Antwort (TimeStampResp oder TimeStampToken) in der letzten Signatur, signierte Bytes unverändert, und gibt das PDF zurück.
Auf nexpdf_sdk · Modul signatures · C nexpdf_add_signature_timestamp
ltv_requests_json
pub fn ltv_requests_json(data: &[u8], responses_json: impl StrArg) -> Result<String>B-LT in Schritten: die HTTP-Anfragen (OCSP, CRL, Zertifikate), die die Validierungsdaten noch brauchen, gegeben die bisherigen Antworten; [], wenn nichts fehlt.
Auf nexpdf_sdk · Modul signatures · C nexpdf_ltv_requests_json
ltv_requests_json_value
pub fn ltv_requests_json_value( data: &[u8], responses_json: impl StrArg, ) -> Result<serde_json::Value>B-LT in Schritten: die HTTP-Anfragen (OCSP, CRL, Zertifikate), die die Validierungsdaten noch brauchen, gegeben die bisherigen Antworten; [], wenn nichts fehlt.
Auf nexpdf_sdk · Modul signatures · C nexpdf_ltv_requests_json
add_ltv_with_responses
pub fn add_ltv_with_responses(data: &[u8], responses_json: impl StrArg) -> Result<Vec<u8>>B-LT in Schritten: fügt den /DSS aus den abgerufenen Antworten hinzu (fehlende zählen als fehlgeschlagen), als inkrementelles Update, und gibt das PDF zurück.
Auf nexpdf_sdk · Modul signatures · C nexpdf_add_ltv_with_responses
validate_lta_json
pub fn validate_lta_json(data: &[u8], trust_roots_pem: impl StrArg) -> Result<String>Vollständige PAdES-B-LTA-Validierung: ob der /DSS jeder zeitgestempelten Revision jedes Zertifikat und jeden verifizierten OCSP- oder CRL-Eintrag enthält, den die früheren Signaturen und Zeitstempel brauchen. Gibt complete und timestamps mit ihren issues zurück.
Auf nexpdf_sdk · Modul signatures · C nexpdf_validate_lta_json
validate_lta_json_value
pub fn validate_lta_json_value( data: &[u8], trust_roots_pem: impl StrArg, ) -> Result<serde_json::Value>Vollständige PAdES-B-LTA-Validierung: ob der /DSS jeder zeitgestempelten Revision jedes Zertifikat und jeden verifizierten OCSP- oder CRL-Eintrag enthält, den die früheren Signaturen und Zeitstempel brauchen. Gibt complete und timestamps mit ihren issues zurück.
Auf nexpdf_sdk · Modul signatures · C nexpdf_validate_lta_json
PDF/A, PDF/X und PDF/UA
convert_pdfa
pub fn convert_pdfa(&mut self) -> Result<i32>Konvertiert das Dokument für die Archivierung in PDF/A (ISO 19005).
Auf Document · Modul standards · C nexpdf_convert_pdfa
convert_pdfx
pub fn convert_pdfx(&mut self) -> Result<i32>Konvertiert das Dokument für den Druckaustausch in PDF/X.
Auf Document · Modul standards · C nexpdf_convert_pdfx
auto_tag
pub fn auto_tag(&mut self, lang: impl StrArg, force: i32) -> Result<String>Taggt das Dokument für die Barrierefreiheit (PDF/UA-Strukturbaum, Sprache, Titel, Metadaten). lang ist ein BCP-47-Tag (Standard en-US); force taggt ein bereits getaggtes Dokument neu. Gibt einen JSON-Bericht zurück.
Auf Document · Modul standards · C nexpdf_auto_tag
validate_pdfa_json
pub fn validate_pdfa_json(&self, level: impl StrArg) -> Result<String>Regelbasierte PDF/A-Validierung für 1a bis 4f (die deklarierte Stufe oder 2b, wenn leer): compliant, level und failures mit clause, message, page und object.
Auf Document · Modul standards · C nexpdf_validate_pdfa_json
validate_pdfa_json_value
pub fn validate_pdfa_json_value(&self, level: impl StrArg) -> Result<serde_json::Value>Regelbasierte PDF/A-Validierung für 1a bis 4f (die deklarierte Stufe oder 2b, wenn leer): compliant, level und failures mit clause, message, page und object.
Auf Document · Modul standards · C nexpdf_validate_pdfa_json
validate_pdfua_json
pub fn validate_pdfua_json(&self) -> Result<String>PDF/UA-Validierung (PDF/UA-1 oder PDF/UA-2, wenn deklariert), mit demselben Bericht wie die PDF/A-Validierung.
Auf Document · Modul standards · C nexpdf_validate_pdfua_json
validate_pdfua_json_value
pub fn validate_pdfua_json_value(&self) -> Result<serde_json::Value>PDF/UA-Validierung (PDF/UA-1 oder PDF/UA-2, wenn deklariert), mit demselben Bericht wie die PDF/A-Validierung.
Auf Document · Modul standards · C nexpdf_validate_pdfua_json
convert_pdfa_level
pub fn convert_pdfa_level(&mut self, level: impl StrArg) -> Result<i32>Konvertiert in eine gewählte PDF/A-Stufe (2b, wenn leer); Stufe A taggt das Dokument zuerst. 1, wenn das Ergebnis validiert; andernfalls listet der Fehler die Klauseln auf, die noch fehlschlagen.
Auf Document · Modul standards · C nexpdf_convert_pdfa_level
convert_pdfa_json
pub fn convert_pdfa_json( &mut self, level: impl StrArg, flatten_dpi: f64, substitute_fonts: i32, ) -> Result<String>Konvertiert in eine PDF/A-Stufe (1a bis 4f, 2b, wenn leer) und gibt den Bericht zurück: level, compliant, fixed, substitutions und remaining. flatten_dpi ist die Auflösung, mit der die Transparenz von PDF/A-1 verflacht wird (300 bei 0 oder weniger); substitute_fonts 0 lässt nicht eingebettete Schriften unangetastet.
Auf Document · Modul standards · C nexpdf_convert_pdfa_json
convert_pdfa_json_value
pub fn convert_pdfa_json_value( &mut self, level: impl StrArg, flatten_dpi: f64, substitute_fonts: i32, ) -> Result<serde_json::Value>Konvertiert in eine PDF/A-Stufe (1a bis 4f, 2b, wenn leer) und gibt den Bericht zurück: level, compliant, fixed, substitutions und remaining. flatten_dpi ist die Auflösung, mit der die Transparenz von PDF/A-1 verflacht wird (300 bei 0 oder weniger); substitute_fonts 0 lässt nicht eingebettete Schriften unangetastet.
Auf Document · Modul standards · C nexpdf_convert_pdfa_json
convert_pdfua_json
pub fn convert_pdfua_json(&mut self, part: i32, lang: impl StrArg) -> Result<String>Konvertiert in PDF/UA-1 oder PDF/UA-2 (Teil 1 oder 2): taggt ein ungetaggtes Dokument, bettet Schriften ein und verwendet für Teil 2 die PDF-2.0-Namensräume. lang (en-US, wenn leer) gilt, wenn das Dokument keine hat. Gibt profile, compliant, fixed, warnings, substitutions, remaining zurück.
Auf Document · Modul standards · C nexpdf_convert_pdfua_json
convert_pdfua_json_value
pub fn convert_pdfua_json_value( &mut self, part: i32, lang: impl StrArg, ) -> Result<serde_json::Value>Konvertiert in PDF/UA-1 oder PDF/UA-2 (Teil 1 oder 2): taggt ein ungetaggtes Dokument, bettet Schriften ein und verwendet für Teil 2 die PDF-2.0-Namensräume. lang (en-US, wenn leer) gilt, wenn das Dokument keine hat. Gibt profile, compliant, fixed, warnings, substitutions, remaining zurück.
Auf Document · Modul standards · C nexpdf_convert_pdfua_json
validate_pdfua_part_json
pub fn validate_pdfua_part_json(&self, part: i32) -> Result<String>Validiert gegen PDF/UA-1 oder PDF/UA-2 (Teil 1 oder 2), unabhängig davon, was das Dokument deklariert, mit demselben Bericht wie die PDF/UA-Validierung.
Auf Document · Modul standards · C nexpdf_validate_pdfua_part_json
validate_pdfua_part_json_value
pub fn validate_pdfua_part_json_value(&self, part: i32) -> Result<serde_json::Value>Validiert gegen PDF/UA-1 oder PDF/UA-2 (Teil 1 oder 2), unabhängig davon, was das Dokument deklariert, mit demselben Bericht wie die PDF/UA-Validierung.
Auf Document · Modul standards · C nexpdf_validate_pdfua_part_json
register_substitute_font
pub fn register_substitute_font(data: &[u8]) -> Result<String>Registriert TrueType-Schriftdaten für die Schriftersetzung bei PDF/A und PDF/UA: nicht eingebettete Schriften mit demselben PostScript- oder Familiennamen verwenden sie. Gibt den PostScript-Namen zurück, oder nichts, wenn die Daten keine TrueType-Schrift mit glyf-Umrissen sind.
Auf nexpdf_sdk · Modul standards · C nexpdf_register_substitute_font
OCR
ocr
pub fn ocr(&mut self, options_json: impl StrArg) -> Result<String>Erkennt gescannte Seiten und fügt eine unsichtbare, durchsuchbare Textebene hinzu. Optionen (dürfen entfallen): {"engine":"auto|builtin|tesseract|neural","languages":"por+eng","dpi":300,"pages":[0],"force":false}. Gibt einen JSON-Bericht zurück.
Auf Document · Modul ocr · C nexpdf_ocr
ocr_load_model
pub fn ocr_load_model( options_json: impl StrArg, model: &[u8], dictionary: impl StrArg, ) -> Result<i32>Lädt zur Laufzeit ein neuronales OCR-Modell (ONNX): {"kind":"detection"|"recognition"|"classification","languages","name","input_height","max_side"}; ein Recognition-Modell braucht sein Zeichenwörterbuch, ein Detection-Modell oder ein Klassifikator der Textrichtung (0°/180°) braucht keines.
Auf nexpdf_sdk · Modul ocr · C nexpdf_ocr_load_model
ocr_models_json
pub fn ocr_models_json() -> Result<String>Die geladenen OCR-Modelle: kind, name, languages, symbols, size.
Auf nexpdf_sdk · Modul ocr · C nexpdf_ocr_models_json
ocr_models_json_value
pub fn ocr_models_json_value() -> Result<serde_json::Value>Die geladenen OCR-Modelle: kind, name, languages, symbols, size.
Auf nexpdf_sdk · Modul ocr · C nexpdf_ocr_models_json
ocr_unload_models
pub fn ocr_unload_models(languages: impl StrArg) -> Result<i32>Entlädt die OCR-Modelle der angegebenen Sprachen (alle, wenn leer). Gibt die Anzahl der entfernten zurück.
Auf nexpdf_sdk · Modul ocr · C nexpdf_ocr_unload_models
Vergleichen, optimieren und Speicher
compare_json
pub fn compare_json(&self, b: &Document, dpi: f64) -> Result<String>Vergleicht zwei Dokumente (Text- und visuelle Unterschiede pro Seite) mit der angegebenen Auflösung, als JSON.
Auf Document · immer verfügbar · C nexpdf_compare_json
compare_json_value
pub fn compare_json_value(&self, b: &Document, dpi: f64) -> Result<serde_json::Value>Vergleicht zwei Dokumente (Text- und visuelle Unterschiede pro Seite) mit der angegebenen Auflösung, als JSON.
Auf Document · immer verfügbar · C nexpdf_compare_json
compare_overlay_png
pub fn compare_overlay_png( &self, b: &Document, page_index: usize, dpi: f64, ) -> Result<Vec<u8>>Ein PNG-Overlay der visuellen Unterschiede einer Seite zweier Dokumente.
Auf Document · immer verfügbar · C nexpdf_compare_overlay_png
optimize
pub fn optimize(&mut self) -> Result<String>Optimiert das Dokument (entfernt nicht verwendete Objekte, komprimiert Streams neu); gibt einen JSON-Bericht zurück.
Auf Document · Modul editor · C nexpdf_optimize
subset_fonts
pub fn subset_fonts(&mut self) -> Result<String>Reduziert die eingebetteten Schriften auf die Glyphen, die das Dokument verwendet; gibt einen JSON-Bericht zurück.
Auf Document · Modul editor · C nexpdf_subset_fonts
trim_memory
pub fn trim_memory(&mut self) -> usizeVerwirft zwischengespeicherte Daten des Dokuments; gibt die freigegebenen Bytes zurück.
Auf Document · immer verfügbar · C nexpdf_trim_memory
memory_usage_bytes
pub fn memory_usage_bytes(&self) -> usizeUngefährer vom Dokument belegter Speicher in Bytes.
Auf Document · immer verfügbar · C nexpdf_memory_usage_bytes
compare_text_json
pub fn compare_text_json(&self, b: &Document, options_json: impl StrArg) -> Result<String>Textvergleich auf Wortebene zweier Dokumente: eingefügter, gelöschter, ersetzter und verschobener Text mit Positionen sowie eine Zusammenfassung. Optionen {"ignore_case","ignore_punctuation","detect_moves","min_move_words","align","page_map"}.
Auf Document · immer verfügbar · C nexpdf_compare_text_json
compare_text_json_value
pub fn compare_text_json_value( &self, b: &Document, options_json: impl StrArg, ) -> Result<serde_json::Value>Textvergleich auf Wortebene zweier Dokumente: eingefügter, gelöschter, ersetzter und verschobener Text mit Positionen sowie eine Zusammenfassung. Optionen {"ignore_case","ignore_punctuation","detect_moves","min_move_words","align","page_map"}.
Auf Document · immer verfügbar · C nexpdf_compare_text_json
compare_annotate
pub fn compare_annotate(&self, b: &Document, options_json: impl StrArg) -> Result<Vec<u8>>Der Vergleich auf Wortebene als neues PDF mit Hervorhebungs-Annotationen (gelöscht rot, eingefügt grün, verschoben blau). Die Optionen ergänzen output, author und die Farben.
Auf Document · immer verfügbar · C nexpdf_compare_annotate
Weitere
set_annotation_flags
pub fn set_annotation_flags( &mut self, num: u32, generation: u16, flags_json: impl StrArg, ) -> Result<i32>Annotations-Flags (/F). flags_json: {"readonly":true,"print":false} ändert nur die Flags, die es nennt; ["print","locked"] setzt genau diese; eine Zahl ist die Bitmaske. Namen: invisible, hidden, print, nozoom, norotate, noview, readonly, locked, togglenoview, lockedcontents. XFDF-Import und -Export behalten sie bei (flags="print,readonly"). 1 bei Erfolg.
Auf Document
set_annotation_style
pub fn set_annotation_style( &mut self, num: u32, generation: u16, style_json: impl StrArg, ) -> Result<i32>Farbe, Deckkraft und Rahmenbreite, danach eine neue Darstellung: {"color":"#RRGGBB","opacity":0.5, "border_width":2}, jeder Schlüssel optional (ein fehlender Schlüssel behält den aktuellen Wert). 1 bei Erfolg.
Auf Document