API-Referenz
Jede Klasse, Methode und Funktion des NexPDF-C++-SDK, nach Funktion gruppiert. Generiert aus NexPDF 1.1.0.
Generiert aus NexPDF 1.1.0
Diese Seite wird aus den Quellen von nexpdf.hpp (CMake-Target nexdevit::nexpdf) generiert. Sie listet 193 Member auf. Optionen und Ergebnisse, die JSON-Strings sind, verwenden in jedem NexPDF-SDK dasselbe JSON. Modul ist das Lizenzmodul, das ein Aufruf benötigt; als „immer verfügbar" gekennzeichnete Aufrufe funktionieren ohne Lizenzschlüssel.
Einrichtung und Lebenszyklus
open_bytes
static Document open_bytes(const std::vector<uint8_t>& data, const std::optional<std::string>& password = std::nullopt)Öffnet ein PDF (oder ein JPEG-/PNG-/TIFF-Bild) aus Bytes; Word-, Excel- und PowerPoint-Dateien, EPUB-/FictionBook-/XPS-Bücher und CBZ-Comics werden konvertiert. Ein Passwort öffnet verschlüsselte Dateien.
Auf Document
open
static Document open(const std::string& path, const std::optional<std::string>& password = std::nullopt)Liest und öffnet eine Datei; siehe open_bytes.
Auf Document
handle
NexPdfDocument* handle() const noexceptDas C-Handle, für Aufrufe, die hier nicht gekapselt sind. Es bleibt im Besitz dieses Objekts.
Auf Document
save
void save(const std::string& path, bool linearized = false) constSchreibt das Dokument; linearized schreibt eine „Fast Web View"-Datei.
Auf Document
copy
Document copy() constEine unabhängige Kopie (für Snapshots zum Rückgängigmachen oder für Arbeit in einem anderen Thread).
Auf Document
reset
void reset() noexceptGibt das native Dokument sofort frei.
Auf Document
version
inline std::string version()Die Version der Engine.
Auf namespace nexdevit::nexpdf
activate_license
inline int32_t activate_license(const std::string& key_or_xml, const std::string& platform, const std::string& app_id)Aktiviert einen Lizenzschlüssel oder eine license.xml einmal pro Prozess: 2 (lizenziert) oder 1 (Test); wirft sonst Error mit dem negativen Code. Ohne Lizenz ist das SDK nur zum Ansehen geeignet, und Renderings tragen ein Wasserzeichen. platform: android, ios, web, windows, macos, linux oder server.
Auf namespace nexdevit::nexpdf
tsa_trampoline
inline int32_t tsa_trampoline(const uint8_t* request, size_t len, void*, const uint8_t** out_token, size_t* out_len) noexceptDer C-Callback: ruft die registrierte std::function auf; die Antwort liegt in einem Puffer pro Thread bis zum nächsten Aufruf in diesem Thread (NexPDF kopiert sie, wenn die Funktion zurückkehrt).
Auf namespace nexdevit::nexpdf
set_tsa_callback
inline void set_tsa_callback(TsaCallback callback)Registriert eine prozessweite Zeitstempelstelle (eine leere Funktion hebt sie auf). Wird verwendet, wenn add_document_timestamp(_bytes) kein "tsa_url" erhält, sowie von sign_pkcs12 / complete_external_signature mit "level" B-T, B-LT oder B-LTA; "tsa_url" hat immer Vorrang. Der Callback kann in jedem Thread laufen, der NexPDF aufruft, und darf set_tsa_callback nicht aufrufen. Wirft er, schlägt der NexPDF-Aufruf mit "TSA callback failed (code 1)" fehl; eine leere Antwort ergibt Code 2.
Auf namespace nexdevit::nexpdf
clear_tsa_callback
inline void clear_tsa_callback()Hebt die Registrierung des Callbacks der Zeitstempelstelle auf (B-T und höher benötigen dann wieder "tsa_url").
Auf namespace nexdevit::nexpdf
is_licensed
inline bool is_licensed(const std::string& module)Ob die aktive Lizenz das Modul freischaltet (annotations, forms, editor, security, redaction, signatures, conversion, ocr, standards).
Auf namespace nexdevit::nexpdf
Bibliothek und Lizenzierung
license_status_json
inline std::string license_status_json()Die gesamte API hinter einem JSON-Aufruf, für Brücken, die nur Strings übergeben: {"fn":"to_xlsx","args":[handle]} liefert {"ok":true,"result":...} oder {"ok":false,"error":"..."}. Dokumente sind Handle-Nummern und Byte-Puffer Base64.
Auf namespace nexdevit::nexpdf · immer verfügbar · C nexpdf_invoke
invoke
inline std::string invoke(const std::optional<std::string>& request_json = std::nullopt)Die gesamte API hinter einem JSON-Aufruf, für Brücken, die nur Strings übergeben: {"fn":"to_xlsx","args":[handle]} liefert {"ok":true,"result":...} oder {"ok":false,"error":"..."}. Dokumente sind Handle-Nummern und Byte-Puffer Base64.
Auf namespace nexdevit::nexpdf · immer verfügbar · C nexpdf_invoke
register_standard_font
inline int32_t register_standard_font(const std::vector<uint8_t>& data)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 erforderlich. 1 bei Erfolg, 0, wenn die Schrift keine solche ist.
Auf namespace nexdevit::nexpdf · immer verfügbar · C nexpdf_register_standard_font
Öffnen und Speichern
open_bytes_with_password
inline Document open_bytes_with_password(const std::vector<uint8_t>& data, const std::optional<std::string>& password = std::nullopt)Ö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 namespace nexdevit::nexpdf · immer verfügbar · C nexpdf_open_bytes_with_password
from_html
inline Document from_html(const std::optional<std::string>& html = std::nullopt)Layoutet HTML als neues PDF-Dokument.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_from_html
has_bundled_fonts
inline int32_t has_bundled_fonts()Konvertiert Word-, Excel- oder PowerPoint-Bytes (Format wird erkannt) in ein neues PDF-Dokument.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_open_office
open_office
inline Document open_office(const std::vector<uint8_t>& data)Konvertiert Word-, Excel- oder PowerPoint-Bytes (Format wird erkannt) in ein neues PDF-Dokument.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_open_office
open_ebook
inline Document open_ebook(const std::vector<uint8_t>& data)Konvertiert EPUB, FictionBook (.fb2, .fb2.zip), XPS/OpenXPS oder ein CBZ-Comic-Archiv in ein neues PDF-Dokument.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_open_ebook
open_image
inline Document open_image(const std::vector<uint8_t>& data)Konvertiert JPEG-, PNG- oder TIFF-Bytes in ein neues PDF, eine Seite pro Bild.
Auf namespace nexdevit::nexpdf · immer verfügbar · C nexpdf_open_image
save_bytes
std::vector<uint8_t> save_bytes() constDas Dokument mit jeder Änderung als PDF-Bytes (vollständiges Neuschreiben).
Auf Document · immer verfügbar · C nexpdf_save_bytes
save_linearized
std::vector<uint8_t> save_linearized() constEin linearisiertes PDF („Fast Web View"): Die erste Seite wird angezeigt, bevor der Download endet.
Auf Document · immer verfügbar · C nexpdf_save_linearized
Seiten und Rendering
page_count
int32_t page_count() constAnzahl der Seiten.
Auf Document · immer verfügbar · C nexpdf_page_count
page_width
double page_width(size_t page_index) constAngezeigte Seitenbreite in Punkt (mit angewendeter Zuschneidebox, Drehung und /UserUnit).
Auf Document · immer verfügbar · C nexpdf_page_width
page_height
double page_height(size_t page_index) constAngezeigte Seitenhöhe in Punkt (mit angewendeter Zuschneidebox, Drehung und /UserUnit).
Auf Document · immer verfügbar · C nexpdf_page_height
page_view_json
std::string page_view_json(size_t page_index) constWie die Seite angezeigt wird: width, height, rotation, user_unit, crop und die Matrix to_display vom PDF zur Anzeige.
Auf Document · immer verfügbar · C nexpdf_page_view_json
render_page_png
std::vector<uint8_t> render_page_png(size_t page_index, double dpi) constRendert 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
std::vector<uint8_t> render_thumb_png(size_t page_index, uint32_t max_dim) constRendert ein PNG-Vorschaubild, dessen längere Seite höchstens max_dim Pixel misst.
Auf Document · immer verfügbar · C nexpdf_render_thumb_png
set_overprint
int32_t set_overprint(int32_t mode)Überdrucksimulation 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
std::string extract_page_text(size_t page_index) constDer Text einer Seite in Lesereihenfolge.
Auf Document · immer verfügbar · C nexpdf_extract_page_text
extract_markdown
std::string extract_markdown() constDas gesamte Dokument als Markdown (Überschriften, Listen, Tabellen).
Auf Document · immer verfügbar · C nexpdf_extract_markdown
search_json
std::string search_json(const std::optional<std::string>& query = std::nullopt) constFindet einen Text auf jeder Seite (ohne Beachtung der Groß- und Kleinschreibung). Liefert ein JSON-Array mit Treffern: page, context und das Rechteck llx, lly, urx, ury in PDF-Punkt.
Auf Document · immer verfügbar · C nexpdf_search_json
page_blocks_json
std::string page_blocks_json(size_t page_index) constDie 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
std::string ask_document(const std::optional<std::string>& question, uint32_t k, uint32_t max_chars) constDokumentassistent-Abruf, offline (BM25): die k für eine Frage relevantesten Passagen und ein seitenmarkierter Kontext mit höchstens max_chars Zeichen (0 = 200000), der an ein Sprachmodell gesendet werden kann. Liefert {"passages":[{"page","text","score"}],"context":"...","context_pages":[...]}.
Auf Document · immer verfügbar · C nexpdf_ask_document
page_words_json
std::string page_words_json(size_t page_index, const std::optional<std::string>& options_json = std::nullopt) constDie Wörter einer Seite mit exakten Boxen aus den Glyphenbreiten und dem Textzustand: text, bbox, quad (folgt gedrehtem Text), font, size, angle, line. {"glyphs":true} fügt die Glyphenboxen hinzu.
Auf Document · immer verfügbar · C nexpdf_page_words_json
Konvertierung
to_html
std::string to_html() constDas Dokument als HTML.
Auf Document · Modul conversion · C nexpdf_to_html
to_json
std::string to_json() constDer Dokumentinhalt als JSON.
Auf Document · Modul conversion · C nexpdf_to_json
to_xml
std::string to_xml() constDer Dokumentinhalt als XML.
Auf Document · Modul conversion · C nexpdf_to_xml
to_csv
std::string to_csv() constTabellen des Dokuments als CSV.
Auf Document · Modul conversion · C nexpdf_to_csv
to_rtf
std::string to_rtf() constDas Dokument als RTF.
Auf Document · Modul conversion · C nexpdf_to_rtf
to_docx
std::vector<uint8_t> to_docx() constDas Dokument als Word-Datei (.docx).
Auf Document · Modul conversion · C nexpdf_to_docx
to_xlsx
std::vector<uint8_t> to_xlsx() constDas Dokument als Excel-Arbeitsmappe, ein Blatt pro Seite.
Auf Document · Modul conversion · C nexpdf_to_xlsx
to_pptx
std::vector<uint8_t> to_pptx() constDas Dokument als PowerPoint-Präsentation, eine Folie pro Seite.
Auf Document · Modul conversion · C nexpdf_to_pptx
to_reflow_html
std::string to_reflow_html(const std::optional<std::string>& options_json = std::nullopt) constDer 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
inline Document open_xlsx_with_clock(const std::vector<uint8_t>& data, double clock_unix_seconds)Konvertiert eine Excel-Arbeitsmappe mit fester Uhr: NOW() und TODAY() in Formeln ohne zwischengespeicherten Wert liefern die angegebene Unix-Zeit (Sekunden, ohne Zeitzone).
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_open_xlsx_with_clock
open_docx_with_options_json
inline Document open_docx_with_options_json(const std::vector<uint8_t>& data, const std::optional<std::string>& options_json = std::nullopt)Konvertiert ein Word-Dokument mit den Optionen {"show_comments":false,"show_revisions":false}: Kommentare in Sprechblasen in einem Markup-Bereich und nachverfolgte Änderungen als Markup gezeichnet statt des endgültigen Dokuments.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_open_docx_with_options_json
Vorlagen
template_docx_to_pdf
inline Document template_docx_to_pdf(const std::vector<uint8_t>& template_bytes, const std::optional<std::string>& data_json = std::nullopt, const std::optional<std::string>& options_json = std::nullopt)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 scheitern.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_template_docx_to_pdf
template_docx_fill
inline std::vector<uint8_t> template_docx_fill(const std::vector<uint8_t>& template_bytes, const std::optional<std::string>& data_json = std::nullopt)Füllt eine Word-Vorlage mit JSON-Daten und liefert die neuen .docx-Bytes.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_template_docx_fill
template_html_to_pdf
inline Document template_html_to_pdf(const std::optional<std::string>& html_utf8 = std::nullopt, const std::optional<std::string>& data_json = std::nullopt, const std::optional<std::string>& options_json = std::nullopt)Füllt eine HTML-Vorlage mit JSON-Daten (Werte HTML-escaped, {{{raw}}} nicht) und layoutet sie als neues PDF-Dokument.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_template_html_to_pdf
template_fill_pdf
int32_t template_fill_pdf(const std::optional<std::string>& data_json = std::nullopt, const std::optional<std::string>& options_json = std::nullopt)Füllt eine PDF-Vorlage an Ort und Stelle: AcroForm-Felder nach Namen und Platzhalter im Seitentext. Optionen {"flatten","fields","text","strict","locale"}. Liefert die Anzahl der gefüllten Felder und Textzeilen.
Auf Document · Modul conversion · C nexpdf_template_fill_pdf
template_docx_fill_with
inline std::vector<uint8_t> template_docx_fill_with(const std::vector<uint8_t>& template_bytes, const std::optional<std::string>& data_json = std::nullopt, const std::optional<std::string>& options_json = std::nullopt)Füllt eine Word-Vorlage mit JSON-Daten und den Optionen {"strict","locale"} und liefert die neuen .docx-Bytes.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_template_docx_fill_with
Office-Bearbeitung
xlsx_edit
inline std::vector<uint8_t> xlsx_edit(const std::vector<uint8_t>& data, const std::optional<std::string>& edits_json = std::nullopt)Setzt Zellen einer Excel-Arbeitsmappe (Zahlen, Text, Boolesche Werte, Formeln oder null zum Leeren), berechnet jede Formel und die Diagramme neu und liefert die neuen .xlsx-Bytes. JSON {"sheet","edits":[{"cell","value"}],"ranges":[{"start","rows"}],"recalculate"}.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_xlsx_edit
xlsx_cells_json
inline std::string xlsx_cells_json(const std::vector<uint8_t>& data, const std::optional<std::string>& options_json = std::nullopt)Die Zellen einer Excel-Arbeitsmappe als JSON: pro Blatt jede Zelle mit Typ, Wert und Formel. Optionen {"sheet","range","recalculate"}.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_xlsx_cells_json
docx_edit
inline std::vector<uint8_t> docx_edit(const std::vector<uint8_t>& data, const std::optional<std::string>& ops_json = std::nullopt)Wendet Operationen auf ein Word-Dokument an und liefert die neuen .docx-Bytes: replace (über Runs, Kopf- und Fußzeilen hinweg), set_text, insert und delete von Absätzen.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_docx_edit
docx_paragraphs_json
inline std::string docx_paragraphs_json(const std::vector<uint8_t>& data)Die Absätze eines Word-Dokuments als JSON: Index, Format, Text und ob jeder in einer Tabelle steht.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_docx_paragraphs_json
Strukturierte Extraktion und Barcodes
extract_tables_json
std::string extract_tables_json(int32_t page_index, const std::optional<std::string>& options_json = std::nullopt) constTabellen 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
std::string extract_key_values_json(const std::optional<std::string>& options_json = std::nullopt) constBezeichner-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
std::string extraction_prompt_json(const std::optional<std::string>& schema_json = std::nullopt, const std::optional<std::string>& options_json = std::nullopt) constEin 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
std::string extraction_validate_json(const std::optional<std::string>& schema_json = std::nullopt, const std::optional<std::string>& answer_json = std::nullopt) constValidiert eine Modellantwort gegen das Schema, wandelt 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
std::string classify_document_json(const std::optional<std::string>& labels_json = std::nullopt) constKlassifiziert 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
std::string read_barcodes_json(int32_t page_index, const std::optional<std::string>& options_json = std::nullopt) constLiest 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-Punkt.
Auf Document · Modul conversion · C nexpdf_read_barcodes_json
read_barcodes_image_json
inline std::string read_barcodes_image_json(const std::vector<uint8_t>& data, const std::optional<std::string>& options_json = std::nullopt)Liest die Barcodes eines PNG- oder JPEG-Bilds, mit Positionen in Pixeln.
Auf namespace nexdevit::nexpdf · Modul conversion · C nexpdf_read_barcodes_image_json
add_barcode
int32_t add_barcode(size_t page_index, double llx, double lly, double urx, double ury, const std::optional<std::string>& format = std::nullopt, const std::optional<std::string>& text = std::nullopt)Zeichnet Text als Vektor-Barcode (weißer Hintergrund, Ruhezone) in ein Rechteck einer Seite, in PDF-Punkt.
Auf Document · Modul editor · C nexpdf_add_barcode
add_barcode_ex
int32_t add_barcode_ex(size_t page_index, double llx, double lly, double urx, double ury, const std::optional<std::string>& format = std::nullopt, const std::optional<std::string>& text = std::nullopt, const std::optional<std::string>& options_json = std::nullopt)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
int32_t add_annotation(size_t page_index, const std::optional<std::string>& kind, const std::optional<std::string>& color_hex, double opacity, const std::optional<std::string>& contents, double llx, double lly, double urx, double ury)Fügt eine Annotation hinzu. kind ist ein PDF-Annotationsuntertyp 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 ist in PDF-Punkt.
Auf Document · Modul annotations · C nexpdf_add_annotation
add_ink
int32_t add_ink(size_t page_index, const std::optional<std::string>& color_hex, double stroke_width, double opacity, const std::optional<std::string>& coords = std::nullopt)Fügt eine Freihand-Annotation hinzu. coords ist "x,y;x,y;..." in PDF-Punkt.
Auf Document · Modul annotations · C nexpdf_add_ink
add_line
int32_t add_line(size_t page_index, const std::optional<std::string>& kind, const std::optional<std::string>& color_hex, double opacity, double stroke_width, double x1, double y1, double x2, double y2)Fügt eine Linie oder einen Pfeil hinzu (kind ist Line oder Arrow) von (x1, y1) nach (x2, y2) in PDF-Punkt.
Auf Document · Modul annotations · C nexpdf_add_line
annotations_json
std::string annotations_json(size_t page_index) constDie Annotationen einer Seite als JSON: num, gen, kind, color, contents und das Rechteck.
Auf Document · immer verfügbar · C nexpdf_annotations_json
remove_annotation
int32_t remove_annotation(size_t page_index, uint32_t num, uint16_t generation)Entfernt die Annotation mit der Objektnummer num und der Generation gen von einer Seite.
Auf Document · Modul annotations · C nexpdf_remove_annotation
move_annotation
int32_t move_annotation(uint32_t num, uint16_t generation, double dx, double dy)Verschiebt eine Annotation um (dx, dy) PDF-Punkt.
Auf Document · Modul annotations · C nexpdf_move_annotation
set_annotation_contents
int32_t set_annotation_contents(uint32_t num, uint16_t generation, const std::optional<std::string>& contents = std::nullopt)Ersetzt den Textinhalt einer Annotation.
Auf Document · Modul annotations · C nexpdf_set_annotation_contents
export_xfdf
std::string export_xfdf() constExportiert jede Annotation als XFDF-Dokument.
Auf Document · Modul annotations · C nexpdf_export_xfdf
import_xfdf
int32_t import_xfdf(const std::optional<std::string>& xfdf = std::nullopt)Importiert Annotationen aus einem XFDF-Dokument.
Auf Document · Modul annotations · C nexpdf_import_xfdf
flatten_annotations
int32_t flatten_annotations(int32_t page_index)Brennt Annotationen in den Seiteninhalt ein. Ein negativer Seitenindex verflacht jede Seite.
Auf Document · Modul annotations · C nexpdf_flatten_annotations
add_image_stamp
int32_t add_image_stamp(size_t page, double llx, double lly, double urx, double ury, const std::vector<uint8_t>& rgba, uint32_t width, uint32_t height, double opacity)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
std::string add_measurement(size_t page, const std::optional<std::string>& json = std::nullopt)Speichert eine Messung: {"kind":"distance|perimeter|area","points":[[x,y],...],"unit":"mm","per_point":0.3528,"label":"1:100","color":"#2f54d6"}. Liefert {"num","gen","value","text"}.
Auf Document · Modul annotations · C nexpdf_add_measurement
measurements_json
std::string measurements_json() constDie gespeicherten Messungen als JSON.
Auf Document · immer verfügbar · C nexpdf_measurements_json
add_file_attachment_annot
int32_t add_file_attachment_annot(size_t page_index, double x, double y, const std::optional<std::string>& name, const std::vector<uint8_t>& data, const std::optional<std::string>& mime = std::nullopt, const std::optional<std::string>& description = std::nullopt)Fügt eine Büroklammer-Annotation mit einer Datei hinzu; (x, y) ist die obere linke Ecke des Symbols in PDF-Punkt.
Auf Document · Modul annotations · C nexpdf_add_file_attachment_annot
add_ink_signature
int32_t add_ink_signature(size_t page_index, const std::optional<std::string>& color_hex, double stroke_width, const std::optional<std::string>& strokes = std::nullopt)Fügt eine handschriftliche Signatur hinzu: eine Freihand-Annotation mit mehreren Strichen ("x,y;x,y|x,y;x,y", PDF-Punkt) und dem Betreff "Signature". Nur visuell; verwenden Sie für eine kryptografische eine PAdES-Signatur.
Auf Document · Modul annotations · C nexpdf_add_ink_signature
reply_to_annotation
int32_t reply_to_annotation(size_t page_index, uint32_t num, uint16_t generation, const std::optional<std::string>& author = std::nullopt, const std::optional<std::string>& text = std::nullopt)Fügt eine Antwort von author auf eine Annotation (oder auf eine andere Antwort) hinzu. Liefert die Objektnummer der Antwort (Generation 0).
Auf Document · Modul annotations · C nexpdf_reply_to_annotation
annotation_replies_json
std::string annotation_replies_json(size_t page_index, uint32_t num, uint16_t generation) constDer Verlauf 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
int32_t set_annotation_state(size_t page_index, uint32_t num, uint16_t generation, const std::optional<std::string>& author = std::nullopt, const std::optional<std::string>& state = std::nullopt)Setzt einen Prüfstatus (Accepted, Rejected, Cancelled, Completed, None) oder Markierungsstatus (Marked, Unmarked) als verborgene Statusantwort. Liefert deren Objektnummer.
Auf Document · Modul annotations · C nexpdf_set_annotation_state
Formulare
form_fields_json
std::string form_fields_json() constDie Formularfelder als JSON: name, kind, value, page, Rechteck, read_only und required.
Auf Document · Modul forms · C nexpdf_form_fields_json
fill_form_field
int32_t fill_form_field(const std::optional<std::string>& name = std::nullopt, const std::optional<std::string>& value = std::nullopt)Setzt einen Feldwert, wie es ein Viewer täte: Die Keystroke- und Validate-Skripte prüfen den Wert, dann 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
int32_t set_signature_appearance(const std::optional<std::string>& name, const std::vector<uint8_t>& rgba, uint32_t width, uint32_t height)Zeigt eine gezeichnete, getippte oder gescannte Signatur (RGBA-Pixel) in einem Signaturfeld an, ohne digital zu signieren; passend auf jedes Widget skaliert und zentriert. Eine spätere digitale Signatur ersetzt sie.
Auf Document · Modul forms · C nexpdf_set_signature_appearance
add_form_field
int32_t add_form_field(size_t page_index, const std::optional<std::string>& kind, const std::optional<std::string>& name, double llx, double lly, double urx, double ury)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
int32_t flatten_forms()Brennt die Formularfelder in den Seiteninhalt ein.
Auf Document · Modul forms · C nexpdf_flatten_forms
recalculate_forms
int32_t recalculate_forms()Führt jedes Berechnungsskript aus; liefert, wie viele Felder sich geändert haben.
Auf Document · Modul forms · C nexpdf_recalculate_forms
export_form_json
std::string export_form_json() constDie Feldwerte als JSON-Objekt.
Auf Document · Modul forms · C nexpdf_export_form_json
import_form_json
int32_t import_form_json(const std::optional<std::string>& json = std::nullopt)Füllt Felder aus einem JSON-Objekt mit Namen und Werten.
Auf Document · Modul forms · C nexpdf_import_form_json
export_form_fdf
std::vector<uint8_t> export_form_fdf(const std::optional<std::string>& pdf_name = std::nullopt) constDie Feldwerte als FDF-Datei; pdf_name ist der darin vermerkte Dateiname.
Auf Document · Modul forms · C nexpdf_export_form_fdf
import_form_fdf
int32_t import_form_fdf(const std::vector<uint8_t>& data)Füllt Felder aus einer FDF-Datei.
Auf Document · Modul forms · C nexpdf_import_form_fdf
export_form_xfdf
std::string export_form_xfdf(const std::optional<std::string>& pdf_name = std::nullopt) constDie Feldwerte als XFDF.
Auf Document · Modul forms · C nexpdf_export_form_xfdf
import_form_xfdf
int32_t import_form_xfdf(const std::optional<std::string>& xfdf = std::nullopt)Füllt Felder aus XFDF.
Auf Document · Modul forms · C nexpdf_import_form_xfdf
XFA-Formulare
xfa_info_json
std::string xfa_info_json() constOb das Dokument XFA enthält, ob es dynamisch ist, Feld- und Datenanzahlen und die XDP-Pakete.
Auf Document · Modul forms · C nexpdf_xfa_info_json
xfa_export_data
std::string xfa_export_data(const std::optional<std::string>& format = std::nullopt) constDie XFA-Daten als xml (Standard) oder flaches json ({"path":"value"}). Schlägt fehl, wenn das Dokument kein XFA enthält.
Auf Document · Modul forms · C nexpdf_xfa_export_data
xfa_import_data
int32_t xfa_import_data(const std::optional<std::string>& data = std::nullopt, const std::optional<std::string>& format = std::nullopt)Importiert XFA-Daten: XML ersetzt die Daten, JSON setzt die angegebenen Werte. Bei statischen Formularen werden die AcroForm-Felder aktualisiert. Liefert die Anzahl der importierten Werte.
Auf Document · Modul forms · C nexpdf_xfa_import_data
xfa_to_acroform
int32_t xfa_to_acroform()Konvertiert in ein einfaches AcroForm-PDF und entfernt XFA; dynamische Formulare werden in neue Seiten layoutet, und Skripte laufen zuerst. Textfelder behalten ihren formatierten Anzeigewert als /V. Liefert die Anzahl der AcroForm-Felder.
Auf Document · Modul forms · C nexpdf_xfa_to_acroform
xfa_flatten
int32_t xfa_flatten()Konvertiert und verflacht das XFA-Formular: ein einfaches PDF mit gezeichneten Werten. Liefert die Anzahl der verflachten Widgets.
Auf Document · Modul forms · C nexpdf_xfa_flatten
xfa_remove
int32_t xfa_remove()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
std::string xfa_to_acroform_json(const std::optional<std::string>& options_json = std::nullopt)Konvertiert in AcroForm mit den Optionen {"scripts":true,"flatten":false} und liefert einen Bericht: 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
std::string xfa_run_scripts_json()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
inline int32_t register_fallback_font(const std::vector<uint8_t>& data)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 layoutet werden; die Daten werden kopiert. 1 oder -1.
Auf namespace nexdevit::nexpdf · Modul forms · C nexpdf_register_fallback_font
Zusammenarbeit in Echtzeit
sync_export_json
std::string sync_export_json(uint64_t since_version)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
std::string sync_export_local_json(uint64_t since_version)NexPDF Sync: nur die eigenen Änderungen dieser Kopie über since_version (was ein Client sendet); behalten Sie die gelieferte clock für den nächsten Aufruf.
Auf Document · Modul annotations · C nexpdf_sync_export_local_json
sync_apply_json
std::string sync_apply_json(const std::optional<std::string>& changes_json = std::nullopt)NexPDF Sync: wendet entfernte Änderungen an, der zuletzt Schreibende gewinnt pro Datensatz. Liefert ok, clock, applied, ignored, conflicts und errors.
Auf Document · Modul annotations · C nexpdf_sync_apply_json
sync_snapshot_json
std::string sync_snapshot_json()NexPDF Sync: jeden Datensatz mit seiner Version, einschließlich Basisdatensätzen und Tombstones.
Auf Document · Modul annotations · C nexpdf_sync_snapshot_json
sync_set_client_id
int32_t sync_set_client_id(const std::optional<std::string>& client_id = std::nullopt)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
int32_t rotate_page(size_t page_index, int32_t degrees)Dreht eine Seite um ein Vielfaches von 90 Grad.
Auf Document · Modul editor · C nexpdf_rotate_page
delete_page
int32_t delete_page(size_t page_index)Löscht eine Seite.
Auf Document · Modul editor · C nexpdf_delete_page
duplicate_page
int32_t duplicate_page(size_t page_index)Fügt eine Kopie einer Seite nach dieser ein.
Auf Document · Modul editor · C nexpdf_duplicate_page
add_blank_page
int32_t add_blank_page()Hängt eine leere Seite an.
Auf Document · Modul editor · C nexpdf_add_blank_page
reverse_pages
int32_t reverse_pages()Kehrt die Seitenreihenfolge um.
Auf Document · Modul editor · C nexpdf_reverse_pages
move_page
int32_t move_page(size_t from, size_t to)Verschiebt die Seite bei from an den Index to.
Auf Document · Modul editor · C nexpdf_move_page
crop_page
int32_t crop_page(size_t page_index, double llx, double lly, double urx, double ury)Setzt die Zuschneidebox einer Seite (PDF-Punkt).
Auf Document · Modul editor · C nexpdf_crop_page
extract_pages
Document extract_pages(const std::vector<uint32_t>& indices) constEin neues Dokument aus den angegebenen Seiten (Teilen).
Auf Document · Modul editor · C nexpdf_extract_pages
append_document
int32_t append_document(const Document& other)Hängt die Seiten eines anderen Dokuments an (Zusammenführen).
Auf Document · Modul editor · C nexpdf_append_document
insert_image_pages
int32_t insert_image_pages(size_t index, const std::vector<uint8_t>& data)Fügt die Bilder einer JPEG-, PNG- oder TIFF-Datei als Seiten vor index ein (begrenzt; die Seitenanzahl hängt an). Liefert die Anzahl der hinzugefügten Seiten.
Auf Document · immer verfügbar · C nexpdf_insert_image_pages
set_page_background
int32_t set_page_background(const std::optional<std::string>& options_json, const std::vector<uint8_t>& rgb, uint32_t width, uint32_t height)Setzt einen Seitenhintergrund: eine Farbe und/oder ein RGB-Bild. Optionen: {"color":"#fbf4e2","fit":"cover|stretch|center","scale":1,"opacity":1,"pages":[]}. Liefert die geänderten Seiten.
Auf Document · Modul editor · C nexpdf_set_page_background
remove_page_background
int32_t remove_page_background(const std::optional<std::string>& pages_json = std::nullopt)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
std::string page_content_json(size_t page) constDie 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
int32_t edit_text(size_t page, const std::optional<std::string>& id = std::nullopt, const std::optional<std::string>& change_json = std::nullopt)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
int32_t add_page_text(size_t page, const std::optional<std::string>& json = std::nullopt)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
int32_t delete_content(size_t page, const std::optional<std::string>& id = std::nullopt)Löscht eine Textzeile oder ein Bild des Seiteninhalts.
Auf Document · Modul editor · C nexpdf_delete_content
transform_image
int32_t transform_image(size_t page, const std::optional<std::string>& id, double llx, double lly, double urx, double ury)Verschiebt ein Bild oder ändert seine Größe auf ein Rechteck (PDF-Punkt).
Auf Document · Modul editor · C nexpdf_transform_image
replace_image
int32_t replace_image(size_t page, const std::optional<std::string>& id, const std::vector<uint8_t>& rgb, uint32_t width, uint32_t height)Ersetzt ein Bild durch RGB-Pixel (Breite x Höhe x 3 Bytes).
Auf Document · Modul editor · C nexpdf_replace_image
edit_text_block
int32_t edit_text_block(size_t page_index, const std::optional<std::string>& text, const std::optional<std::string>& color_hex, double font_size, int32_t bold, int32_t italic, int32_t replace_existing, double llx, double lly, double urx, double ury)Schreibt einen Textblock in ein Rechteck mit Farbe, Größe und Stil, optional unter Ersetzung des dort bereits vorhandenen Texts.
Auf Document · Modul editor · C nexpdf_edit_text_block
Metadaten, Lesezeichen, Ebenen und Anlagen
metadata_json
std::string metadata_json() constDie Dokumentinformationen (Titel, Autor, Betreff, Schlüsselwörter, ...) als JSON.
Auf Document · immer verfügbar · C nexpdf_metadata_json
set_metadata
int32_t set_metadata(const std::optional<std::string>& title = std::nullopt, const std::optional<std::string>& author = std::nullopt, const std::optional<std::string>& subject = std::nullopt, const std::optional<std::string>& keywords = std::nullopt)Setzt Titel, Autor, Betreff und Schlüsselwörter. Ausgelassene (null) Werte behalten den aktuellen.
Auf Document · Modul editor · C nexpdf_set_metadata
outlines_json
std::string outlines_json() constDie Lesezeichen als JSON: [{"title","page","children":[...]}].
Auf Document · immer verfügbar · C nexpdf_outlines_json
set_outlines_json
int32_t set_outlines_json(const std::optional<std::string>& json = std::nullopt)Ersetzt die Lesezeichen durch einen JSON-Baum derselben Form.
Auf Document · Modul editor · C nexpdf_set_outlines_json
page_labels_json
std::string page_labels_json() constSeitenbezeichnungen: {"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
int32_t set_page_labels_json(const std::optional<std::string>& json = std::nullopt)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
std::string layers_json() constDie optionalen Inhaltsgruppen (Ebenen): [{"num","gen","name","visible","printable"}].
Auf Document · immer verfügbar · C nexpdf_layers_json
set_layer_visible
int32_t set_layer_visible(uint32_t num, uint16_t generation, int32_t visible)Zeigt oder verbirgt eine Ebene.
Auf Document · immer verfügbar · C nexpdf_set_layer_visible
attachments_json
std::string attachments_json() constDie eingebetteten Dateien: [{"name","description","mime","size","page"}]; page ist bei Dateien auf Dokumentebene null.
Auf Document · immer verfügbar · C nexpdf_attachments_json
attachment_data
std::vector<uint8_t> attachment_data(const std::optional<std::string>& name = std::nullopt) constDie Bytes einer eingebetteten Datei.
Auf Document · immer verfügbar · C nexpdf_attachment_data
add_attachment
int32_t add_attachment(const std::optional<std::string>& name, const std::vector<uint8_t>& data, const std::optional<std::string>& mime = std::nullopt, const std::optional<std::string>& description = std::nullopt)Bettet eine Datei auf Dokumentebene ein.
Auf Document · Modul editor · C nexpdf_add_attachment
remove_attachment
int32_t remove_attachment(const std::optional<std::string>& name = std::nullopt)Entfernt eine eingebettete Datei.
Auf Document · Modul editor · C nexpdf_remove_attachment
Verschlüsselung, Wasserzeichen und Stempel
encrypt_aes256
int32_t encrypt_aes256(const std::optional<std::string>& user_pw = std::nullopt, const std::optional<std::string>& owner_pw = std::nullopt)Verschlüsselt mit AES-256 unter Verwendung eines Benutzerpassworts (zum Öffnen) und eines Besitzerpassworts.
Auf Document · Modul security · C nexpdf_encrypt_aes256
encrypt_with_permissions
int32_t encrypt_with_permissions(const std::optional<std::string>& user_pw, const std::optional<std::string>& owner_pw, uint32_t permissions)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
std::string security_json() constDer Verschlüsselungszustand: {"encrypted","revision","owner","print","modify","copy","annotate","fill_forms","assemble"}.
Auf Document · immer verfügbar · C nexpdf_security_json
remove_password
int32_t remove_password(const std::optional<std::string>& password = std::nullopt)Entfernt den Schutz. Erfordert Besitzerzugriff: Das Dokument wurde mit dem Besitzerpasswort geöffnet, oder Sie übergeben es hier.
Auf Document · Modul security · C nexpdf_remove_password
add_watermark
int32_t add_watermark(const std::optional<std::string>& text = std::nullopt)Bringt auf jeder Seite ein Text-Wasserzeichen an.
Auf Document · Modul security · C nexpdf_add_watermark
remove_watermarks
int32_t remove_watermarks()Entfernt die von NexPDF hinzugefügten Wasserzeichen.
Auf Document · Modul security · C nexpdf_remove_watermarks
add_header_footer
int32_t add_header_footer(const std::optional<std::string>& header, const std::optional<std::string>& footer, double font_size)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
int32_t add_bates(const std::optional<std::string>& prefix, uint64_t start, uint32_t digits)Fügt eine Bates-Nummerierung hinzu: prefix, erste Nummer und Anzahl der Stellen.
Auf Document · Modul security · C nexpdf_add_bates
Schwärzung
apply_redaction
int32_t apply_redaction(size_t page_index, double llx, double lly, double urx, double ury, int32_t fill_white)Entfernt Text, Bilder und Annotationen unter einem Rechteck dauerhaft und malt ein deckendes Kästchen darüber, schwarz oder weiß.
Auf Document · Modul redaction · C nexpdf_apply_redaction
redact_matches
int32_t redact_matches(const std::optional<std::string>& query, int32_t mode, int32_t fill_white)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). Liefert die Anzahl der geschwärzten Bereiche.
Auf Document · Modul redaction · C nexpdf_redact_matches
Digitale Signaturen
sign_pades
std::vector<uint8_t> sign_pades(const std::optional<std::string>& signer = std::nullopt, const std::optional<std::string>& reason = std::nullopt, const std::optional<std::string>& location = std::nullopt) constSigniert mit einem neuen selbstsignierten Testzertifikat (PAdES B-B) und liefert die signierte Datei. Schreiben Sie die Bytes unverändert: Erneutes Speichern des Dokuments zerstört die Signatur.
Auf Document · Modul signatures · C nexpdf_sign_pades
sign_pkcs12
std::vector<uint8_t> sign_pkcs12(const std::vector<uint8_t>& p12, const std::optional<std::string>& password = std::nullopt, const std::optional<std::string>& options_json = std::nullopt) constSigniert mit einer PKCS#12-Identität (.p12/.pfx) und liefert die signierte Datei. 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
inline std::string pkcs12_info_json(const std::vector<uint8_t>& data, const std::optional<std::string>& password = std::nullopt)Die Zertifikatszusammenfassung einer PKCS#12-Datei; schlägt bei falschem Passwort mit "incorrect password" fehl.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_pkcs12_info_json
prepare_external_signature
std::vector<uint8_t> prepare_external_signature(const std::vector<uint8_t>& cert, const std::optional<std::string>& options_json = std::nullopt) constExternes 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
inline std::vector<uint8_t> external_signature_data(const std::vector<uint8_t>& prepared, const std::vector<uint8_t>& cert)Externes Signieren, Schritt 2: die zu signierenden Bytes (DER-signierte Attribute; signieren Sie bei Geräten, die einen Digest übernehmen, deren SHA-256).
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_external_signature_data
complete_external_signature
inline std::vector<uint8_t> complete_external_signature(const std::vector<uint8_t>& prepared, const std::vector<uint8_t>& cert, const std::vector<uint8_t>& signature, int32_t algorithm, const std::optional<std::string>& options_json = std::nullopt)Externes Signieren, Schritt 3: bettet die Signatur ein und liefert das signierte PDF. algorithm: 0 RSA PKCS#1 v1.5 SHA-256, 1 ECDSA SHA-256. Optionen: {"tsa_url":"...","ltv":true}.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_complete_external_signature
verify_signatures_json
inline std::string verify_signatures_json(const std::vector<uint8_t>& data)Verifiziert jede Signatur einer signierten Datei (ihre exakten Bytes). Jeder Eintrag hat field, signer, subject, digest_ok, signature_ok, covers_whole_document, reason, signing_time, timestamp_ok, chain_ok, trusted, revocation, ltv, level und mehr.
Auf namespace nexdevit::nexpdf · immer verfügbar · C nexpdf_verify_signatures_json
verify_signatures_with_roots_json
inline std::string verify_signatures_with_roots_json(const std::vector<uint8_t>& data, const std::optional<std::string>& roots_pem = std::nullopt)Verifiziert die Signaturen und behandelt die PEM-Zertifikate in roots_pem als Vertrauensanker.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_verify_signatures_with_roots_json
add_ltv
inline std::vector<uint8_t> add_ltv(const std::vector<uint8_t>& data)Fügt einer signierten Datei Daten zur Langzeitvalidierung hinzu (DSS mit OCSP-Antworten und CRLs).
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_add_ltv
add_document_timestamp
std::vector<uint8_t> add_document_timestamp(const std::optional<std::string>& options_json = std::nullopt) constFügt einen RFC-3161-Dokumentzeitstempel einer TSA hinzu (PAdES B-LTA). Optionen: {"tsa_url" (required),"hash","field","reserved","ltv"}; mit ltv gelangen zuerst die Validierungsdaten früherer Signaturen in das DSS. Liefert die neue Datei.
Auf Document · Modul signatures · C nexpdf_add_document_timestamp
add_document_timestamp_bytes
inline std::vector<uint8_t> add_document_timestamp_bytes(const std::vector<uint8_t>& data, const std::optional<std::string>& options_json = std::nullopt)Fügt den Bytes einer PDF-Datei einen Dokumentzeitstempel hinzu (zum Beispiel direkt aus dem Signieren). Dieselben Optionen. Liefert die neue Datei.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_add_document_timestamp_bytes
prepare_document_timestamp
std::vector<uint8_t> prepare_document_timestamp(const std::optional<std::string>& options_json = std::nullopt) constDokumentzeitstempel von Ihrer eigenen TSA oder Ihrem eigenen 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
inline std::vector<uint8_t> document_timestamp_request(const std::vector<uint8_t>& prepared, const std::optional<std::string>& hash = std::nullopt)Dokumentzeitstempel, Schritt 2: der DER-kodierte TimeStampReq, der als application/timestamp-query an die TSA zu senden ist (Hash standardmäßig SHA-256).
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_document_timestamp_request
complete_document_timestamp
inline std::vector<uint8_t> complete_document_timestamp(const std::vector<uint8_t>& prepared, const std::vector<uint8_t>& token)Dokumentzeitstempel, Schritt 3: das zeitgestempelte PDF, aus der vorbereiteten Datei und dem TSA-Token (TimeStampResp oder TimeStampToken).
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_complete_document_timestamp
signature_timestamp_request
inline std::vector<uint8_t> signature_timestamp_request(const std::vector<uint8_t>& data, const std::optional<std::string>& hash = std::nullopt)B-T in Schritten: der DER-kodierte TimeStampReq über den Wert der letzten Signatur (standardmäßig SHA-256), der als application/timestamp-query per POST an die TSA zu senden ist.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_signature_timestamp_request
add_signature_timestamp
inline std::vector<uint8_t> add_signature_timestamp(const std::vector<uint8_t>& data, const std::vector<uint8_t>& token)B-T in Schritten: speichert die TSA-Antwort (TimeStampResp oder TimeStampToken) in der letzten Signatur, signierte Bytes unverändert, und liefert das PDF.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_add_signature_timestamp
ltv_requests_json
inline std::string ltv_requests_json(const std::vector<uint8_t>& data, const std::optional<std::string>& responses_json = std::nullopt)B-LT in Schritten: die HTTP-Anfragen (OCSP, CRL, Zertifikate), die die Validierungsdaten noch benötigen, gegeben die bisherigen Antworten; [], wenn nichts fehlt.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_ltv_requests_json
add_ltv_with_responses
inline std::vector<uint8_t> add_ltv_with_responses(const std::vector<uint8_t>& data, const std::optional<std::string>& responses_json = std::nullopt)B-LT in Schritten: fügt das /DSS aus den abgerufenen Antworten hinzu (fehlende zählen als fehlgeschlagen), als inkrementelles Update, und liefert das PDF.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_add_ltv_with_responses
validate_lta_json
inline std::string validate_lta_json(const std::vector<uint8_t>& data, const std::optional<std::string>& trust_roots_pem = std::nullopt)Vollständige PAdES-B-LTA-Validierung: ob das /DSS jeder zeitgestempelten Revision jedes Zertifikat und jeden verifizierten OCSP- oder CRL-Eintrag enthält, den die früheren Signaturen und Zeitstempel benötigen. Liefert complete und timestamps mit ihren issues.
Auf namespace nexdevit::nexpdf · Modul signatures · C nexpdf_validate_lta_json
PDF/A, PDF/X und PDF/UA
convert_pdfa
int32_t convert_pdfa()Konvertiert das Dokument für die Archivierung in PDF/A (ISO 19005).
Auf Document · Modul standards · C nexpdf_convert_pdfa
convert_pdfx
int32_t convert_pdfx()Konvertiert das Dokument für den Druckaustausch in PDF/X.
Auf Document · Modul standards · C nexpdf_convert_pdfx
auto_tag
std::string auto_tag(const std::optional<std::string>& lang, int32_t force)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. Liefert einen JSON-Bericht.
Auf Document · Modul standards · C nexpdf_auto_tag
validate_pdfa_json
std::string validate_pdfa_json(const std::optional<std::string>& level = std::nullopt) constRegelbasierte 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
std::string validate_pdfua_json() constPDF/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
int32_t convert_pdfa_level(const std::optional<std::string>& level = std::nullopt)Konvertiert in eine gewählte PDF/A-Stufe (2b, wenn leer); Stufe A taggt das Dokument zuerst. 1, wenn das Ergebnis validiert; sonst listet der Fehler die noch fehlschlagenden Klauseln auf.
Auf Document · Modul standards · C nexpdf_convert_pdfa_level
convert_pdfa_json
std::string convert_pdfa_json(const std::optional<std::string>& level, double flatten_dpi, int32_t substitute_fonts)Konvertiert in eine PDF/A-Stufe (1a bis 4f, 2b, wenn leer) und liefert den Bericht: level, compliant, fixed, substitutions und remaining. flatten_dpi ist die Auflösung, mit der die PDF/A-1-Transparenz verflacht wird (300 bei 0 oder weniger); substitute_fonts 0 lässt nicht eingebettete Schriften unberührt.
Auf Document · Modul standards · C nexpdf_convert_pdfa_json
convert_pdfua_json
std::string convert_pdfua_json(int32_t part, const std::optional<std::string>& lang = std::nullopt)Konvertiert in PDF/UA-1 oder PDF/UA-2 (Teil 1 oder 2): taggt ein nicht getaggtes Dokument, bettet Schriften ein und verwendet für Teil 2 die PDF-2.0-Namespaces. lang (en-US, wenn leer) gilt, wenn das Dokument keine hat. Liefert profile, compliant, fixed, warnings, substitutions, remaining.
Auf Document · Modul standards · C nexpdf_convert_pdfua_json
validate_pdfua_part_json
std::string validate_pdfua_part_json(int32_t part) constValidiert 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
inline std::string register_substitute_font(const std::vector<uint8_t>& data)Registriert TrueType-Schriftdaten für den Schriftersatz bei PDF/A und PDF/UA: Nicht eingebettete Schriften mit demselben PostScript- oder Familiennamen verwenden sie. Liefert den PostScript-Namen oder nichts, wenn die Daten keine TrueType-Schrift mit glyf-Konturen sind.
Auf namespace nexdevit::nexpdf · Modul standards · C nexpdf_register_substitute_font
OCR
ocr
std::string ocr(const std::optional<std::string>& options_json = std::nullopt)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}. Liefert einen JSON-Bericht.
Auf Document · Modul ocr · C nexpdf_ocr
ocr_load_model
inline int32_t ocr_load_model(const std::optional<std::string>& options_json, const std::vector<uint8_t>& model, const std::optional<std::string>& dictionary = std::nullopt)Lädt zur Laufzeit ein neuronales OCR-Modell (ONNX): {"kind":"detection"|"recognition"|"classification","languages","name","input_height","max_side"}; ein Erkennungsmodell benötigt sein Zeichenwörterbuch, ein Detektionsmodell oder ein Textrichtungsklassifikator (0°/180°) benötigt keines.
Auf namespace nexdevit::nexpdf · Modul ocr · C nexpdf_ocr_load_model
ocr_models_json
inline std::string ocr_models_json()Entlädt die OCR-Modelle der angegebenen Sprachen (alle, wenn leer). Liefert die Anzahl der entfernten.
Auf namespace nexdevit::nexpdf · Modul ocr · C nexpdf_ocr_unload_models
ocr_unload_models
inline int32_t ocr_unload_models(const std::optional<std::string>& languages = std::nullopt)Entlädt die OCR-Modelle der angegebenen Sprachen (alle, wenn leer). Liefert die Anzahl der entfernten.
Auf namespace nexdevit::nexpdf · Modul ocr · C nexpdf_ocr_unload_models
Vergleichen, optimieren und Speicher
compare_json
std::string compare_json(const Document& b, double dpi) constVergleicht 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
std::vector<uint8_t> compare_overlay_png(const Document& b, size_t page_index, double dpi) constEine PNG-Überlagerung der visuellen Unterschiede einer Seite zweier Dokumente.
Auf Document · immer verfügbar · C nexpdf_compare_overlay_png
optimize
std::string optimize()Optimiert das Dokument (entfernt ungenutzte Objekte, komprimiert Streams neu); liefert einen JSON-Bericht.
Auf Document · Modul editor · C nexpdf_optimize
subset_fonts
std::string subset_fonts()Reduziert die eingebetteten Schriften auf die vom Dokument verwendeten Glyphen; liefert einen JSON-Bericht.
Auf Document · Modul editor · C nexpdf_subset_fonts
trim_memory
size_t trim_memory()Verwirft zwischengespeicherte Daten des Dokuments; liefert die freigegebenen Bytes.
Auf Document · immer verfügbar · C nexpdf_trim_memory
memory_usage_bytes
size_t memory_usage_bytes() constUngefährer vom Dokument belegter Speicher, in Bytes.
Auf Document · immer verfügbar · C nexpdf_memory_usage_bytes
compare_text_json
std::string compare_text_json(const Document& b, const std::optional<std::string>& options_json = std::nullopt) constWortgenauer Textvergleich 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
std::vector<uint8_t> compare_annotate(const Document& b, const std::optional<std::string>& options_json = std::nullopt) constDer wortgenaue Vergleich 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
int32_t set_annotation_flags(uint32_t num, uint16_t generation, const std::optional<std::string>& flags_json = std::nullopt)Annotationsflags (/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 (flags="print,readonly"). 1 bei Erfolg.
Auf Document
set_annotation_style
int32_t set_annotation_style(uint32_t num, uint16_t generation, const std::optional<std::string>& style_json = std::nullopt)Farbe, Deckkraft und Randbreite, dann 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