Zum Inhalt springen
NexPDF

API-Referenz

Jede Klasse, Methode und Funktion des NexPDF-iOS-SDKs (Swift), nach Funktionen gruppiert. Generiert aus NexPDF 1.1.0.

Deutsch

Generiert aus NexPDF 1.1.0

Diese Seite wird aus den Quellen des Produkts NexPdf des Swift-Packages generiert. Sie listet 194 Mitglieder auf. Optionen und Ergebnisse, die JSON-Strings sind, verwenden in jedem NexPDF-SDK dasselbe JSON. Modul ist das Lizenzmodul, das ein Aufruf braucht; als „immer verfügbar“ markierte Aufrufe funktionieren ohne Lizenzschlüssel.

Einrichtung und Lebenszyklus

message

let message: String

In NexPdfError

isLicense

var isLicense: Bool

In NexPdfError

errorDescription

var errorDescription: String?

In NexPdfError

description

var description: String

In NexPdfError

version

static var version: String

In NexPdf

activateLicense

static func activateLicense(_ keyOrXml: String, appId: String? = Bundle.main.bundleIdentifier, platform: String? = nil) throws -> Int32

Aktiviert einen Lizenzschlüssel oder eine Lizenz-XML. Unter iOS muss der Schlüssel für die Plattform ios und die Bundle-ID der App ausgestellt sein. Gibt 2 (lizenziert) oder 1 (Test) zurück; wirft sonst einen Fehler.

In NexPdf

licenseStatus

static var licenseStatus: [String: Any]

Aktuelle Lizenz als JSON: state, licensee, tier, modules, days_left, watermark.

In NexPdf

isLicensed

static func isLicensed(_ module: String) -> Bool

Die Lizenz erlaubt module (annotations, forms, editor, security, redaction, signatures, conversion, ocr, standards).

In NexPdf

json

static func json(_ s: String) -> Any?

Parst ein JSON-Ergebnis (…Json()-Methoden) in Foundation-Objekte.

In NexPdf

open

static func open(data: Data, password: String? = nil) throws -> NexPdfDocument
static func open(url: URL, password: String? = nil) throws -> NexPdfDocument

Öffnet ein PDF oder konvertiert aus Bytes eine Word-/Excel-/PowerPoint-Datei, ein EPUB-/FictionBook-/XPS-Buch oder einen CBZ-Comic.

In NexPdfDocument

pages

var pages: Int

Anzahl der Seiten.

In NexPdfDocument

pageSize

func pageSize(_ page: Int) -> CGSize

Angezeigte Seitengröße in Punkten: Beschnittrahmen (auf die Media Box begrenzt), /Rotate und /UserUnit angewendet. Um zwischen der angezeigten Seite und dem PDF-Benutzerraum abzubilden, verwenden Sie pageViewJson(pageIndex:) (seine Matrix to_display, oder die Inverse für Taps).

In NexPdfDocument

copy

func copy() throws -> NexPdfDocument

Eine unabhängige Kopie (für Rückgängig-Snapshots oder Hintergrundarbeit).

In NexPdfDocument

write

func write(to url: URL) throws

Schreibt das Dokument nach url.

In NexPdfDocument

Bibliothek und Lizenzierung

registerStandardFont

static func registerStandardFont(data: Data) throws -> Int32

Registriert eine zu Helvetica, Times oder Courier kompatible TrueType-Schriftart (zum Beispiel Liberation), die für nicht eingebettete Standardschriftarten und PDF/A verwendet wird. Nur für Builds ohne gebündelte Schriftarten nötig. 1 bei Erfolg, 0, wenn die Schriftart keine solche ist.

In NexPdf · immer verfügbar · C nexpdf_register_standard_font

hasBundledFonts

static func hasBundledFonts() throws -> Int32

1, wenn die Liberation-Schriftarten einkompiliert sind, 0 in den schlankeren Builds.

In NexPdf · immer verfügbar · C nexpdf_has_bundled_fonts

Öffnen und Speichern

openBytesWithPassword

static func openBytesWithPassword(data: Data, password: String? = nil) throws -> NexPdfDocument

Ö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.

In NexPdfDocument · immer verfügbar · C nexpdf_open_bytes_with_password

fromHtml

static func fromHtml(html: String? = nil) throws -> NexPdfDocument

Layoutet HTML als neues PDF-Dokument.

In NexPdfDocument · Modul conversion · C nexpdf_from_html

openOffice

static func openOffice(data: Data) throws -> NexPdfDocument

Konvertiert Word-, Excel- oder PowerPoint-Bytes (Format wird erkannt) in ein neues PDF-Dokument.

In NexPdfDocument · Modul conversion · C nexpdf_open_office

openEbook

static func openEbook(data: Data) throws -> NexPdfDocument

Konvertiert EPUB, FictionBook (.fb2, .fb2.zip), XPS/OpenXPS oder ein CBZ-Comic-Archiv in ein neues PDF-Dokument.

In NexPdfDocument · Modul conversion · C nexpdf_open_ebook

openImage

static func openImage(data: Data) throws -> NexPdfDocument

Konvertiert JPEG-, PNG- oder TIFF-Bytes in ein neues PDF, eine Seite pro Bild.

In NexPdfDocument · immer verfügbar · C nexpdf_open_image

saveBytes

func saveBytes() throws -> Data

Das Dokument mit allen Änderungen als PDF-Bytes (vollständig neu geschrieben).

In NexPdfDocument · immer verfügbar · C nexpdf_save_bytes

saveLinearized

func saveLinearized() throws -> Data

Ein linearisiertes PDF („Fast Web View“): Die erste Seite wird angezeigt, bevor der Download endet.

In NexPdfDocument · immer verfügbar · C nexpdf_save_linearized

Seiten und Rendering

pageCount

func pageCount() throws -> Int32

Anzahl der Seiten.

In NexPdfDocument · immer verfügbar · C nexpdf_page_count

pageWidth

func pageWidth(pageIndex: Int) -> Double

Angezeigte Seitenbreite in Punkten (Beschnittrahmen, Rotation und /UserUnit angewendet).

In NexPdfDocument · immer verfügbar · C nexpdf_page_width

pageHeight

func pageHeight(pageIndex: Int) -> Double

Angezeigte Seitenhöhe in Punkten (Beschnittrahmen, Rotation und /UserUnit angewendet).

In NexPdfDocument · immer verfügbar · C nexpdf_page_height

pageViewJson

func pageViewJson(pageIndex: Int) throws -> String

Wie die Seite angezeigt wird: width, height, rotation, user_unit, crop und die Matrix vom PDF zur Anzeige to_display.

In NexPdfDocument · immer verfügbar · C nexpdf_page_view_json

renderPagePng

func renderPagePng(pageIndex: Int, dpi: Double) throws -> Data

Rendert eine Seite in der angegebenen Auflösung (Punkte pro Zoll) als PNG. Renderings ohne Lizenz und mit Testschlüssel tragen ein Wasserzeichen.

In NexPdfDocument · immer verfügbar · C nexpdf_render_page_png

renderThumbPng

func renderThumbPng(pageIndex: Int, maxDim: UInt32) throws -> Data

Rendert ein PNG als Miniaturansicht, deren längere Seite höchstens max_dim Pixel hat.

In NexPdfDocument · immer verfügbar · C nexpdf_render_thumb_png

setOverprint

func setOverprint(mode: Int32) throws -> Int32

Überdruckensimulation für spätere Renderings: 0 = nur PDF/X-Dokumente (Standard), 1 = immer, 2 = nie.

In NexPdfDocument · immer verfügbar · C nexpdf_set_overprint

Text, Suche und Assistent

extractPageText

func extractPageText(pageIndex: Int) throws -> String

Der Text einer Seite in Lesereihenfolge.

In NexPdfDocument · immer verfügbar · C nexpdf_extract_page_text

extractMarkdown

func extractMarkdown() throws -> String

Das ganze Dokument als Markdown (Überschriften, Listen, Tabellen).

In NexPdfDocument · immer verfügbar · C nexpdf_extract_markdown

searchJson

func searchJson(query: String? = nil) throws -> String

Findet einen Text auf jeder Seite (ohne Beachtung der Groß- und Kleinschreibung). Gibt ein JSON-Array von Treffern zurück: page, context und das Rechteck llx, lly, urx, ury in PDF-Punkten.

In NexPdfDocument · immer verfügbar · C nexpdf_search_json

pageBlocksJson

func pageBlocksJson(pageIndex: Int) throws -> String

Die Textblöcke einer Seite als JSON: text, Schriftgröße size und das Rechteck llx, lly, urx, ury.

In NexPdfDocument · immer verfügbar · C nexpdf_page_blocks_json

askDocument

func askDocument(question: String?, k: UInt32, maxChars: UInt32) throws -> String

Abruf für den Dokumentassistenten, offline (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.

In NexPdfDocument · immer verfügbar · C nexpdf_ask_document

pageWordsJson

func pageWordsJson(pageIndex: Int, optionsJson: String? = nil) throws -> 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} ergänzt die Glyphenrahmen.

In NexPdfDocument · immer verfügbar · C nexpdf_page_words_json

Konvertierung

toHtml

func toHtml() throws -> String

Das Dokument als HTML.

In NexPdfDocument · Modul conversion · C nexpdf_to_html

toJson

func toJson() throws -> String

Der Dokumentinhalt als JSON.

In NexPdfDocument · Modul conversion · C nexpdf_to_json

toXml

func toXml() throws -> String

Der Dokumentinhalt als XML.

In NexPdfDocument · Modul conversion · C nexpdf_to_xml

toCsv

func toCsv() throws -> String

Tabellen des Dokuments als CSV.

In NexPdfDocument · Modul conversion · C nexpdf_to_csv

toRtf

func toRtf() throws -> String

Das Dokument als RTF.

In NexPdfDocument · Modul conversion · C nexpdf_to_rtf

toDocx

func toDocx() throws -> Data

Das Dokument als Word-Datei (.docx).

In NexPdfDocument · Modul conversion · C nexpdf_to_docx

toXlsx

func toXlsx() throws -> Data

Das Dokument als Excel-Arbeitsmappe, ein Tabellenblatt pro Seite.

In NexPdfDocument · Modul conversion · C nexpdf_to_xlsx

toPptx

func toPptx() throws -> Data

Das Dokument als PowerPoint-Präsentation, eine Folie pro Seite.

In NexPdfDocument · Modul conversion · C nexpdf_to_pptx

toReflowHtml

func toReflowHtml(optionsJson: String? = nil) throws -> String

Der Text als responsives HTML für kleine Bildschirme. Optionen (dürfen fehlen): {"pages":[0],"images":true,"full_page":true,"title":"..."}.

In NexPdfDocument · Modul conversion · C nexpdf_to_reflow_html

openXlsxWithClock

static func openXlsxWithClock(data: Data, clockUnixSeconds: Double) throws -> NexPdfDocument

Konvertiert eine Excel-Arbeitsmappe mit fester Uhr: NOW() und TODAY() in Formeln ohne zwischengespeicherten Wert geben die angegebene Unix-Zeit zurück (Sekunden, keine Zeitzone angewendet).

In NexPdfDocument · Modul conversion · C nexpdf_open_xlsx_with_clock

openDocxWithOptionsJson

static func openDocxWithOptionsJson(data: Data, optionsJson: String? = nil) throws -> NexPdfDocument

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.

In NexPdfDocument · Modul conversion · C nexpdf_open_docx_with_options_json

Vorlagen

templateDocxToPdf

static func templateDocxToPdf(templateBytes: Data, dataJson: String? = nil, optionsJson: String? = nil) throws -> NexPdfDocument

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.

In NexPdfDocument · Modul conversion · C nexpdf_template_docx_to_pdf

templateDocxFill

static func templateDocxFill(templateBytes: Data, dataJson: String? = nil) throws -> Data

Füllt eine Word-Vorlage mit JSON-Daten und gibt die Bytes der neuen .docx zurück.

In NexPdf · Modul conversion · C nexpdf_template_docx_fill

templateHtmlToPdf

static func templateHtmlToPdf(htmlUtf8: String? = nil, dataJson: String? = nil, optionsJson: String? = nil) throws -> NexPdfDocument

Füllt eine HTML-Vorlage mit JSON-Daten (Werte HTML-maskiert, {{{raw}}} nicht) und layoutet sie als neues PDF-Dokument.

In NexPdfDocument · Modul conversion · C nexpdf_template_html_to_pdf

templateFillPdf

func templateFillPdf(dataJson: String? = nil, optionsJson: String? = nil) throws -> Int32

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.

In NexPdfDocument · Modul conversion · C nexpdf_template_fill_pdf

templateDocxFillWith

static func templateDocxFillWith(templateBytes: Data, dataJson: String? = nil, optionsJson: String? = nil) throws -> Data

Füllt eine Word-Vorlage mit JSON-Daten und den Optionen {"strict","locale"} und gibt die Bytes der neuen .docx zurück.

In NexPdf · Modul conversion · C nexpdf_template_docx_fill_with

Office-Bearbeitung

xlsxEdit

static func xlsxEdit(data: Data, editsJson: String? = nil) throws -> Data

Setzt Zellen einer Excel-Arbeitsmappe (Zahlen, Text, Booleans, Formeln oder null zum Leeren), berechnet jede Formel und die Diagramme neu und gibt die Bytes der neuen .xlsx zurück. JSON {"sheet","edits":[{"cell","value"}],"ranges":[{"start","rows"}],"recalculate"}.

In NexPdf · Modul conversion · C nexpdf_xlsx_edit

xlsxCellsJson

static func xlsxCellsJson(data: Data, optionsJson: String? = nil) throws -> String

Die Zellen einer Excel-Arbeitsmappe als JSON: pro Tabellenblatt jede Zelle mit Typ, Wert und Formel. Optionen {"sheet","range","recalculate"}.

In NexPdf · Modul conversion · C nexpdf_xlsx_cells_json

docxEdit

static func docxEdit(data: Data, opsJson: String? = nil) throws -> Data

Wendet Operationen auf ein Word-Dokument an und gibt die Bytes der neuen .docx zurück: replace (über Runs, Kopf- und Fußzeilen hinweg), set_text, insert und delete für Absätze.

In NexPdf · Modul conversion · C nexpdf_docx_edit

docxParagraphsJson

static func docxParagraphsJson(data: Data) throws -> String

Die Absätze eines Word-Dokuments als JSON: Index, Formatvorlage, Text und ob sie jeweils in einer Tabelle stehen.

In NexPdf · Modul conversion · C nexpdf_docx_paragraphs_json

Strukturierte Extraktion und Barcodes

extractTablesJson

func extractTablesJson(pageIndex: Int32, optionsJson: String? = nil) throws -> String

Tabellen mit und ohne Linien einer Seite (jede Seite bei negativem Index) mit Zellen, Spannen, CSV und Markdown. Optionen {"ruled","unruled","min_unruled_lines"}.

In NexPdfDocument · Modul conversion · C nexpdf_extract_tables_json

extractKeyValuesJson

func extractKeyValuesJson(optionsJson: String? = nil) throws -> String

Bezeichnung-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"}.

In NexPdfDocument · Modul conversion · C nexpdf_extract_key_values_json

extractionPromptJson

func extractionPromptJson(schemaJson: String? = nil, optionsJson: String? = nil) throws -> String

Ein Prompt (system, prompt, response_schema) zum Extrahieren eines JSON-Schemas mit dem Sprachmodell Ihrer Wahl. Die Engine führt keine Netzwerkaufrufe aus.

In NexPdfDocument · Modul conversion · C nexpdf_extraction_prompt_json

extractionValidateJson

func extractionValidateJson(schemaJson: String? = nil, answerJson: String? = nil) throws -> String

Validiert eine Modellantwort gegen das Schema, wandelt Werte um und verankert jeden Wert auf den Seiten: valid, value, errors, warnings, fields.

In NexPdfDocument · Modul conversion · C nexpdf_extraction_validate_json

classifyDocumentJson

func classifyDocumentJson(labelsJson: String? = nil) throws -> String

Klassifiziert das Dokument anhand von Schlüsselwörtern in eines der angegebenen Labels, mit Scores und einem Prompt für die LLM-Klassifizierung.

In NexPdfDocument · Modul conversion · C nexpdf_classify_document_json

readBarcodesJson

func readBarcodesJson(pageIndex: Int32, optionsJson: String? = nil) throws -> String

Liest die Barcodes einer Seite (jede Seite bei negativem Index): QR, Data Matrix, Aztec, PDF417, Code 128/39/93, EAN/UPC, ITF, Codabar und mehr, mit Positionen in PDF-Punkten.

In NexPdfDocument · Modul conversion · C nexpdf_read_barcodes_json

readBarcodesImageJson

static func readBarcodesImageJson(data: Data, optionsJson: String? = nil) throws -> String

Liest die Barcodes eines PNG- oder JPEG-Bilds, mit Positionen in Pixeln.

In NexPdf · Modul conversion · C nexpdf_read_barcodes_image_json

addBarcode

func addBarcode(pageIndex: Int, llx: Double, lly: Double, urx: Double, ury: Double, format: String? = nil, text: String? = nil) throws -> Int32

Zeichnet Text als Vektor-Barcode (weißer Hintergrund, Ruhezone) in ein Rechteck einer Seite, in PDF-Punkten.

In NexPdfDocument · Modul editor · C nexpdf_add_barcode

addBarcodeEx

func addBarcodeEx(pageIndex: Int, llx: Double, lly: Double, urx: Double, ury: Double, format: String? = nil, text: String? = nil, optionsJson: String? = nil) throws -> Int32

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.

In NexPdfDocument · Modul editor · C nexpdf_add_barcode_ex

Annotationen

addAnnotation

func addAnnotation(pageIndex: Int, kind: String?, colorHex: String?, opacity: Double, contents: String?, llx: Double, lly: Double, urx: Double, ury: Double) throws -> Int32

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 ist in PDF-Punkten.

In NexPdfDocument · Modul annotations · C nexpdf_add_annotation

addInk

func addInk(pageIndex: Int, colorHex: String?, strokeWidth: Double, opacity: Double, coords: String? = nil) throws -> Int32

Fügt eine Freihand-Annotation hinzu. coords ist "x,y;x,y;..." in PDF-Punkten.

In NexPdfDocument · Modul annotations · C nexpdf_add_ink

addLine

func addLine(pageIndex: Int, kind: String?, colorHex: String?, opacity: Double, strokeWidth: Double, x1: Double, y1: Double, x2: Double, y2: Double) throws -> Int32

Fügt eine Linie oder einen Pfeil hinzu (kind ist Line oder Arrow) von (x1, y1) nach (x2, y2) in PDF-Punkten.

In NexPdfDocument · Modul annotations · C nexpdf_add_line

annotationsJson

func annotationsJson(pageIndex: Int) throws -> String

Die Annotationen einer Seite als JSON: num, gen, kind, color, contents und das Rechteck.

In NexPdfDocument · immer verfügbar · C nexpdf_annotations_json

removeAnnotation

func removeAnnotation(pageIndex: Int, num: UInt32, generation: UInt16) throws -> Int32

Entfernt die Annotation mit Objektnummer num und Generation gen von einer Seite.

In NexPdfDocument · Modul annotations · C nexpdf_remove_annotation

moveAnnotation

func moveAnnotation(num: UInt32, generation: UInt16, dx: Double, dy: Double) throws -> Int32

Verschiebt eine Annotation um (dx, dy) PDF-Punkte.

In NexPdfDocument · Modul annotations · C nexpdf_move_annotation

setAnnotationContents

func setAnnotationContents(num: UInt32, generation: UInt16, contents: String? = nil) throws -> Int32

Ersetzt den Textinhalt einer Annotation.

In NexPdfDocument · Modul annotations · C nexpdf_set_annotation_contents

exportXfdf

func exportXfdf() throws -> String

Exportiert jede Annotation als XFDF-Dokument.

In NexPdfDocument · Modul annotations · C nexpdf_export_xfdf

importXfdf

func importXfdf(xfdf: String? = nil) throws -> Int32

Importiert Annotationen aus einem XFDF-Dokument.

In NexPdfDocument · Modul annotations · C nexpdf_import_xfdf

flattenAnnotations

func flattenAnnotations(pageIndex: Int32) throws -> Int32

Brennt Annotationen in den Seiteninhalt ein. Ein negativer Seitenindex verflacht jede Seite.

In NexPdfDocument · Modul annotations · C nexpdf_flatten_annotations

addImageStamp

func addImageStamp(page: Int, llx: Double, lly: Double, urx: Double, ury: Double, rgba: Data, width: UInt32, height: UInt32, opacity: Double) throws -> Int32

Fügt eine Bildstempel-Annotation aus RGBA-Pixeln hinzu (Transparenz bleibt erhalten). 1 bei Erfolg.

In NexPdfDocument · Modul annotations · C nexpdf_add_image_stamp

addMeasurement

func addMeasurement(page: Int, json: String? = nil) throws -> 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.

In NexPdfDocument · Modul annotations · C nexpdf_add_measurement

measurementsJson

func measurementsJson() throws -> String

Die gespeicherten Messungen als JSON.

In NexPdfDocument · immer verfügbar · C nexpdf_measurements_json

addFileAttachmentAnnot

func addFileAttachmentAnnot(pageIndex: Int, x: Double, y: Double, name: String?, data: Data, mime: String? = nil, description: String? = nil) throws -> Int32

Fügt eine Büroklammer-Annotation hinzu, die eine Datei trägt; (x, y) ist die obere linke Ecke des Symbols in PDF-Punkten.

In NexPdfDocument · Modul annotations · C nexpdf_add_file_attachment_annot

addInkSignature

func addInkSignature(pageIndex: Int, colorHex: String?, strokeWidth: Double, strokes: String? = nil) throws -> Int32

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; verwenden Sie für eine kryptografische eine PAdES-Signatur.

In NexPdfDocument · Modul annotations · C nexpdf_add_ink_signature

replyToAnnotation

func replyToAnnotation(pageIndex: Int, num: UInt32, generation: UInt16, author: String? = nil, text: String? = nil) throws -> Int32

Fügt eine Antwort von author auf eine Annotation (oder auf eine andere Antwort) hinzu. Gibt die Objektnummer der Antwort zurück (Generation 0).

In NexPdfDocument · Modul annotations · C nexpdf_reply_to_annotation

annotationRepliesJson

func annotationRepliesJson(pageIndex: Int, num: UInt32, generation: UInt16) throws -> String

Der Thread unter einer Annotation, die älteste zuerst: num, gen, in_reply_to, author, date, text, state, state_model.

In NexPdfDocument · Modul annotations · C nexpdf_annotation_replies_json

setAnnotationState

func setAnnotationState(pageIndex: Int, num: UInt32, generation: UInt16, author: String? = nil, state: String? = nil) throws -> Int32

Setzt einen Prüfstatus (Accepted, Rejected, Cancelled, Completed, None) oder markierten Status (Marked, Unmarked) als verborgene Statusantwort. Gibt deren Objektnummer zurück.

In NexPdfDocument · Modul annotations · C nexpdf_set_annotation_state

Formulare

formFieldsJson

func formFieldsJson() throws -> String

Die Formularfelder als JSON: name, kind, value, page, Rechteck, read_only und required.

In NexPdfDocument · Modul forms · C nexpdf_form_fields_json

fillFormField

func fillFormField(name: String? = nil, value: String? = nil) throws -> Int32

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.

In NexPdfDocument · Modul forms · C nexpdf_fill_form_field

setSignatureAppearance

func setSignatureAppearance(name: String?, rgba: Data, width: UInt32, height: UInt32) throws -> Int32

Zeigt eine gezeichnete, getippte oder gescannte Signatur (RGBA-Pixel) in einem Signaturfeld an, ohne digital zu signieren; wird passend auf jedes Widget skaliert und zentriert. Eine spätere digitale Signatur ersetzt sie.

In NexPdfDocument · Modul forms · C nexpdf_set_signature_appearance

addFormField

func addFormField(pageIndex: Int, kind: String?, name: String?, llx: Double, lly: Double, urx: Double, ury: Double) throws -> Int32

Fügt ein Formularfeld namens name in einem Rechteck einer Seite hinzu. kind: text (Standard), checkbox, radio, combobox, listbox, button, signature oder barcode.

In NexPdfDocument · Modul forms · C nexpdf_add_form_field

flattenForms

func flattenForms() throws -> Int32

Brennt die Formularfelder in den Seiteninhalt ein.

In NexPdfDocument · Modul forms · C nexpdf_flatten_forms

recalculateForms

func recalculateForms() throws -> Int32

Führt jedes Berechnungsskript aus; gibt zurück, wie viele Felder sich geändert haben.

In NexPdfDocument · Modul forms · C nexpdf_recalculate_forms

exportFormJson

func exportFormJson() throws -> String

Die Feldwerte als JSON-Objekt.

In NexPdfDocument · Modul forms · C nexpdf_export_form_json

importFormJson

func importFormJson(json: String? = nil) throws -> Int32

Füllt Felder aus einem JSON-Objekt aus Namen und Werten.

In NexPdfDocument · Modul forms · C nexpdf_import_form_json

exportFormFdf

func exportFormFdf(pdfName: String? = nil) throws -> Data

Die Feldwerte als FDF-Datei; pdf_name ist der darin festgehaltene Dateiname.

In NexPdfDocument · Modul forms · C nexpdf_export_form_fdf

importFormFdf

func importFormFdf(data: Data) throws -> Int32

Füllt Felder aus einer FDF-Datei.

In NexPdfDocument · Modul forms · C nexpdf_import_form_fdf

exportFormXfdf

func exportFormXfdf(pdfName: String? = nil) throws -> String

Die Feldwerte als XFDF.

In NexPdfDocument · Modul forms · C nexpdf_export_form_xfdf

importFormXfdf

func importFormXfdf(xfdf: String? = nil) throws -> Int32

Füllt Felder aus XFDF.

In NexPdfDocument · Modul forms · C nexpdf_import_form_xfdf

XFA-Formulare

xfaInfoJson

func xfaInfoJson() throws -> String

Ob das Dokument XFA hat, ob es dynamisch ist, Feld- und Datenzahlen und die XDP-Packets.

In NexPdfDocument · Modul forms · C nexpdf_xfa_info_json

xfaExportData

func xfaExportData(format: String? = nil) throws -> String

Die XFA-Daten als xml (Standard) oder flaches json ({"path":"value"}). Schlägt fehl, wenn das Dokument kein XFA hat.

In NexPdfDocument · Modul forms · C nexpdf_xfa_export_data

xfaImportData

func xfaImportData(data: String? = nil, format: String? = nil) throws -> Int32

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.

In NexPdfDocument · Modul forms · C nexpdf_xfa_import_data

xfaToAcroform

func xfaToAcroform() throws -> Int32

Konvertiert in ein reines AcroForm-PDF und entfernt XFA; dynamische Formulare werden in neue Seiten gelayoutet, und Skripte laufen zuerst. Textfelder behalten ihren formatierten Anzeigewert als /V. Gibt die Anzahl der AcroForm-Felder zurück.

In NexPdfDocument · Modul forms · C nexpdf_xfa_to_acroform

xfaFlatten

func xfaFlatten() throws -> Int32

Konvertiert und verflacht das XFA-Formular: ein reines PDF mit gezeichneten Werten. Gibt die Anzahl der verflachten Widgets zurück.

In NexPdfDocument · Modul forms · C nexpdf_xfa_flatten

xfaRemove

func xfaRemove() throws -> Int32

Entfernt XFA und behält die AcroForm-Felder und Seiten: 1 entfernt, 0 kein XFA.

In NexPdfDocument · Modul forms · C nexpdf_xfa_remove

xfaToAcroformJson

func xfaToAcroformJson(optionsJson: String? = nil) throws -> 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).

In NexPdfDocument · Modul forms · C nexpdf_xfa_to_acroform_json

xfaRunScriptsJson

func xfaRunScriptsJson() throws -> 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.

In NexPdfDocument · Modul forms · C nexpdf_xfa_run_scripts_json

registerFallbackFont

static func registerFallbackFont(data: Data) throws -> Int32

Registriert eine TrueType-/OpenType-Schriftart (oder .ttc) für Text, den die gebündelten Schriftarten nicht darstellen können (CJK, Arabisch und mehr), wenn XFA-Formulare gelayoutet werden; die Daten werden kopiert. 1 oder -1.

In NexPdf · Modul forms · C nexpdf_register_fallback_font

Echtzeit-Zusammenarbeit

syncExportJson

func syncExportJson(sinceVersion: UInt64) throws -> String

NexPDF Sync: jede Änderung (von jedem Client) mit einer Lamport-Uhr über since_version, als Änderungssatz nexpdf-sync/1.

In NexPdfDocument · Modul annotations · C nexpdf_sync_export_json

syncExportLocalJson

func syncExportLocalJson(sinceVersion: UInt64) throws -> 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.

In NexPdfDocument · Modul annotations · C nexpdf_sync_export_local_json

syncApplyJson

func syncApplyJson(changesJson: String? = nil) throws -> String

NexPDF Sync: wendet entfernte Änderungen an, letzter Schreiber gewinnt pro Datensatz. Gibt ok, clock, applied, ignored, conflicts und errors zurück.

In NexPdfDocument · Modul annotations · C nexpdf_sync_apply_json

syncSnapshotJson

func syncSnapshotJson() throws -> String

NexPDF Sync: jeder Datensatz mit seiner Version, einschließlich Basisdatensätzen und Tombstones.

In NexPdfDocument · Modul annotations · C nexpdf_sync_snapshot_json

syncSetClientId

func syncSetClientId(clientId: String? = nil) throws -> Int32

NexPDF Sync: die Client-ID, unter der diese Kopie ihre Änderungen versioniert (1 bis 64 Zeichen aus [A-Za-z0-9-_.:@]).

In NexPdfDocument · Modul annotations · C nexpdf_sync_set_client_id

Seitenbearbeitung

rotatePage

func rotatePage(pageIndex: Int, degrees: Int32) throws -> Int32

Dreht eine Seite um ein Vielfaches von 90 Grad.

In NexPdfDocument · Modul editor · C nexpdf_rotate_page

deletePage

func deletePage(pageIndex: Int) throws -> Int32

Löscht eine Seite.

In NexPdfDocument · Modul editor · C nexpdf_delete_page

duplicatePage

func duplicatePage(pageIndex: Int) throws -> Int32

Fügt eine Kopie einer Seite nach ihr ein.

In NexPdfDocument · Modul editor · C nexpdf_duplicate_page

addBlankPage

func addBlankPage() throws -> Int32

Hängt eine leere Seite an.

In NexPdfDocument · Modul editor · C nexpdf_add_blank_page

reversePages

func reversePages() throws -> Int32

Kehrt die Seitenreihenfolge um.

In NexPdfDocument · Modul editor · C nexpdf_reverse_pages

movePage

func movePage(from: Int, to: Int) throws -> Int32

Verschiebt die Seite bei from auf den Index to.

In NexPdfDocument · Modul editor · C nexpdf_move_page

cropPage

func cropPage(pageIndex: Int, llx: Double, lly: Double, urx: Double, ury: Double) throws -> Int32

Setzt den Beschnittrahmen einer Seite (PDF-Punkte).

In NexPdfDocument · Modul editor · C nexpdf_crop_page

extractPages

func extractPages(indices: [UInt32]) throws -> NexPdfDocument

Ein neues Dokument aus den angegebenen Seiten (Teilen).

In NexPdfDocument · Modul editor · C nexpdf_extract_pages

appendDocument

func appendDocument(other: NexPdfDocument) throws -> Int32

Hängt die Seiten eines anderen Dokuments an (Zusammenführen).

In NexPdfDocument · Modul editor · C nexpdf_append_document

insertImagePages

func insertImagePages(index: Int, data: Data) throws -> Int32

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.

In NexPdfDocument · immer verfügbar · C nexpdf_insert_image_pages

setPageBackground

func setPageBackground(optionsJson: String?, rgb: Data, width: UInt32, height: UInt32) throws -> Int32

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.

In NexPdfDocument · Modul editor · C nexpdf_set_page_background

removePageBackground

func removePageBackground(pagesJson: String? = nil) throws -> Int32

Entfernt NexPDF-Hintergründe von den Seiten in pages_json ("[0,2]") oder von jeder Seite.

In NexPdfDocument · Modul editor · C nexpdf_remove_page_background

Inhaltsbearbeitung

pageContentJson

func pageContentJson(page: Int) throws -> 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.

In NexPdfDocument · Modul editor · C nexpdf_page_content_json

editText

func editText(page: Int, id: String? = nil, changeJson: String? = nil) throws -> Int32

Bearbeitet eine Textzeile: {text?, size?, color?, dx?, dy?, family?, bold?, italic?}. Leerer Text löscht sie.

In NexPdfDocument · Modul editor · C nexpdf_edit_text

addPageText

func addPageText(page: Int, json: String? = nil) throws -> Int32

Fügt bearbeitbaren Seitentext hinzu: {text, x, y (baseline), size, color, family, bold, italic}.

In NexPdfDocument · Modul editor · C nexpdf_add_page_text

deleteContent

func deleteContent(page: Int, id: String? = nil) throws -> Int32

Löscht eine Textzeile oder ein Bild des Seiteninhalts.

In NexPdfDocument · Modul editor · C nexpdf_delete_content

transformImage

func transformImage(page: Int, id: String?, llx: Double, lly: Double, urx: Double, ury: Double) throws -> Int32

Verschiebt ein Bild oder ändert seine Größe auf ein Rechteck (PDF-Punkte).

In NexPdfDocument · Modul editor · C nexpdf_transform_image

replaceImage

func replaceImage(page: Int, id: String?, rgb: Data, width: UInt32, height: UInt32) throws -> Int32

Ersetzt ein Bild durch RGB-Pixel (Breite x Höhe x 3 Byte).

In NexPdfDocument · Modul editor · C nexpdf_replace_image

editTextBlock

func editTextBlock(pageIndex: Int, text: String?, colorHex: String?, fontSize: Double, bold: Int32, italic: Int32, replaceExisting: Int32, llx: Double, lly: Double, urx: Double, ury: Double) throws -> Int32

Schreibt einen Textblock in ein Rechteck mit Farbe, Größe und Stil und ersetzt optional den dort bereits vorhandenen Text.

In NexPdfDocument · Modul editor · C nexpdf_edit_text_block

Metadaten, Lesezeichen, Ebenen und Anhänge

metadataJson

func metadataJson() throws -> String

Die Dokumentinformationen (Titel, Autor, Thema, Schlüsselwörter, ...) als JSON.

In NexPdfDocument · immer verfügbar · C nexpdf_metadata_json

setMetadata

func setMetadata(title: String? = nil, author: String? = nil, subject: String? = nil, keywords: String? = nil) throws -> Int32

Setzt Titel, Autor, Thema und Schlüsselwörter. Weggelassene Werte (null) behalten den aktuellen.

In NexPdfDocument · Modul editor · C nexpdf_set_metadata

outlinesJson

func outlinesJson() throws -> String

Die Lesezeichen als JSON: [{"title","page","children":[...]}].

In NexPdfDocument · immer verfügbar · C nexpdf_outlines_json

setOutlinesJson

func setOutlinesJson(json: String? = nil) throws -> Int32

Ersetzt die Lesezeichen durch einen JSON-Baum derselben Form.

In NexPdfDocument · Modul editor · C nexpdf_set_outlines_json

pageLabelsJson

func pageLabelsJson() throws -> String

Seitenbeschriftungen: {"labels":["i","ii","1"],"ranges":[{"start":0,"style":"roman","prefix":"","first":1}]}.

In NexPdfDocument · immer verfügbar · C nexpdf_page_labels_json

setPageLabelsJson

func setPageLabelsJson(json: String? = nil) throws -> Int32

Setzt die Bereiche der Seitenbeschriftungen ([] entfernt die Beschriftungen). Stile: decimal, roman, ROMAN, letters, LETTERS, none.

In NexPdfDocument · Modul editor · C nexpdf_set_page_labels_json

layersJson

func layersJson() throws -> String

Die Optional Content Groups (Ebenen): [{"num","gen","name","visible","printable"}].

In NexPdfDocument · immer verfügbar · C nexpdf_layers_json

setLayerVisible

func setLayerVisible(num: UInt32, generation: UInt16, visible: Int32) throws -> Int32

Blendet eine Ebene ein oder aus.

In NexPdfDocument · immer verfügbar · C nexpdf_set_layer_visible

attachmentsJson

func attachmentsJson() throws -> String

Die eingebetteten Dateien: [{"name","description","mime","size","page"}]; page ist null für Dateien auf Dokumentebene.

In NexPdfDocument · immer verfügbar · C nexpdf_attachments_json

attachmentData

func attachmentData(name: String? = nil) throws -> Data

Die Bytes einer eingebetteten Datei.

In NexPdfDocument · immer verfügbar · C nexpdf_attachment_data

addAttachment

func addAttachment(name: String?, data: Data, mime: String? = nil, description: String? = nil) throws -> Int32

Bettet eine Datei auf Dokumentebene ein.

In NexPdfDocument · Modul editor · C nexpdf_add_attachment

removeAttachment

func removeAttachment(name: String? = nil) throws -> Int32

Entfernt eine eingebettete Datei.

In NexPdfDocument · Modul editor · C nexpdf_remove_attachment

Verschlüsselung, Wasserzeichen und Stempel

encryptAes256

func encryptAes256(userPw: String? = nil, ownerPw: String? = nil) throws -> Int32

Verschlüsselt mit AES-256 mit einem Benutzerpasswort (zum Öffnen) und einem Besitzerpasswort.

In NexPdfDocument · Modul security · C nexpdf_encrypt_aes256

encryptWithPermissions

func encryptWithPermissions(userPw: String?, ownerPw: String?, permissions: UInt32) throws -> Int32

Verschlüsselt mit AES-256 und einer Berechtigungsmaske: Drucken 1, Ändern 2, Kopieren 4, Annotieren 8, Formulare ausfüllen 16, Zusammenstellen 32.

In NexPdfDocument · Modul security · C nexpdf_encrypt_with_permissions

securityJson

func securityJson() throws -> String

Der Verschlüsselungszustand: {"encrypted","revision","owner","print","modify","copy","annotate","fill_forms","assemble"}.

In NexPdfDocument · immer verfügbar · C nexpdf_security_json

removePassword

func removePassword(password: String? = nil) throws -> Int32

Entfernt den Schutz. Braucht Besitzerzugriff: Das Dokument wurde mit dem Besitzerpasswort geöffnet, oder übergeben Sie es hier.

In NexPdfDocument · Modul security · C nexpdf_remove_password

addWatermark

func addWatermark(text: String? = nil) throws -> Int32

Bringt auf jeder Seite ein Text-Wasserzeichen an.

In NexPdfDocument · Modul security · C nexpdf_add_watermark

removeWatermarks

func removeWatermarks() throws -> Int32

Entfernt die von NexPDF hinzugefügten Wasserzeichen.

In NexPdfDocument · Modul security · C nexpdf_remove_watermarks

addHeaderFooter

func addHeaderFooter(header: String?, footer: String?, fontSize: Double) throws -> Int32

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.

In NexPdfDocument · Modul security · C nexpdf_add_header_footer

addBates

func addBates(prefix: String?, start: UInt64, digits: UInt32) throws -> Int32

Fügt eine Bates-Nummerierung hinzu: prefix, erste Nummer und Anzahl der Ziffern.

In NexPdfDocument · Modul security · C nexpdf_add_bates

Schwärzung

applyRedaction

func applyRedaction(pageIndex: Int, llx: Double, lly: Double, urx: Double, ury: Double, fillWhite: Int32) throws -> Int32

Entfernt Text, Bilder und Annotationen unter einem Rechteck endgültig und malt ein deckendes Feld darüber, schwarz oder weiß.

In NexPdfDocument · Modul redaction · C nexpdf_apply_redaction

redactMatches

func redactMatches(query: String?, mode: Int32, fillWhite: Int32) throws -> Int32

Findet und schwärzt jeden Treffer endgültig. 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.

In NexPdfDocument · Modul redaction · C nexpdf_redact_matches

Digitale Signaturen

signPades

func signPades(signer: String? = nil, reason: String? = nil, location: String? = nil) throws -> Data

Signiert mit einem neuen selbstsignierten Testzertifikat (PAdES B-B) und gibt die signierte Datei zurück. Schreiben Sie die Bytes unverändert: Erneutes Speichern des Dokuments bricht die Signatur.

In NexPdfDocument · Modul signatures · C nexpdf_sign_pades

signPkcs12

func signPkcs12(p12: Data, password: String? = nil, optionsJson: String? = nil) throws -> Data

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.

In NexPdfDocument · Modul signatures · C nexpdf_sign_pkcs12

pkcs12InfoJson

static func pkcs12InfoJson(data: Data, password: String? = nil) throws -> String

Die Zertifikatszusammenfassung einer PKCS#12-Datei; schlägt bei einem falschen Passwort mit „incorrect password“ fehl.

In NexPdf · Modul signatures · C nexpdf_pkcs12_info_json

prepareExternalSignature

func prepareExternalSignature(cert: Data, optionsJson: String? = nil) throws -> Data

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.

In NexPdfDocument · Modul signatures · C nexpdf_prepare_external_signature

externalSignatureData

static func externalSignatureData(prepared: Data, cert: Data) throws -> Data

Externes Signieren, Schritt 2: die zu signierenden Bytes (DER-codierte signierte Attribute; bei Geräten, die einen Digest annehmen, deren SHA-256 signieren).

In NexPdf · Modul signatures · C nexpdf_external_signature_data

completeExternalSignature

static func completeExternalSignature(prepared: Data, cert: Data, signature: Data, algorithm: Int32, optionsJson: String? = nil) throws -> Data

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}.

In NexPdf · Modul signatures · C nexpdf_complete_external_signature

verifySignaturesJson

static func verifySignaturesJson(data: Data) throws -> String

Prüft 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.

In NexPdf · immer verfügbar · C nexpdf_verify_signatures_json

verifySignaturesWithRootsJson

static func verifySignaturesWithRootsJson(data: Data, rootsPem: String? = nil) throws -> String

Prüft die Signaturen und behandelt die PEM-Zertifikate in roots_pem als Vertrauensanker.

In NexPdf · Modul signatures · C nexpdf_verify_signatures_with_roots_json

addLtv

static func addLtv(data: Data) throws -> Data

Fügt einer signierten Datei Langzeitvalidierungsdaten hinzu (DSS mit OCSP-Antworten und CRLs).

In NexPdf · Modul signatures · C nexpdf_add_ltv

addDocumentTimestamp

func addDocumentTimestamp(optionsJson: String? = nil) throws -> Data

Fügt einen RFC-3161-Dokumentzeitstempel von einer TSA hinzu (PAdES B-LTA). Optionen: {"tsa_url" (required),"hash","field","reserved","ltv"}; mit ltv kommen zuerst die Validierungsdaten früherer Signaturen ins DSS. Gibt die neue Datei zurück.

In NexPdfDocument · Modul signatures · C nexpdf_add_document_timestamp

addDocumentTimestampBytes

static func addDocumentTimestampBytes(data: Data, optionsJson: String? = nil) throws -> Data

Fügt den Bytes einer PDF-Datei einen Dokumentzeitstempel hinzu (zum Beispiel direkt aus dem Signieren). Dieselben Optionen. Gibt die neue Datei zurück.

In NexPdf · Modul signatures · C nexpdf_add_document_timestamp_bytes

prepareDocumentTimestamp

func prepareDocumentTimestamp(optionsJson: String? = nil) throws -> Data

Dokumentzeitstempel von Ihrer eigenen TSA oder Ihrem HSM, Schritt 1: das PDF mit einem leeren Zeitstempel (Optionen wie beim Hinzufügen, aber ohne tsa_url).

In NexPdfDocument · Modul signatures · C nexpdf_prepare_document_timestamp

documentTimestampRequest

static func documentTimestampRequest(prepared: Data, hash: String? = nil) throws -> Data

Dokumentzeitstempel, Schritt 2: die DER-codierte TimeStampReq, die als application/timestamp-query an die TSA zu senden ist (Hash standardmäßig SHA-256).

In NexPdf · Modul signatures · C nexpdf_document_timestamp_request

completeDocumentTimestamp

static func completeDocumentTimestamp(prepared: Data, token: Data) throws -> Data

Dokumentzeitstempel, Schritt 3: das zeitgestempelte PDF, aus der vorbereiteten Datei und dem TSA-Token (TimeStampResp oder TimeStampToken).

In NexPdf · Modul signatures · C nexpdf_complete_document_timestamp

signatureTimestampRequest

static func signatureTimestampRequest(data: Data, hash: String? = nil) throws -> Data

B-T in Schritten: die DER-codierte TimeStampReq über den Wert der letzten Signatur (standardmäßig SHA-256), die per POST als application/timestamp-query an die TSA zu senden ist.

In NexPdf · Modul signatures · C nexpdf_signature_timestamp_request

addSignatureTimestamp

static func addSignatureTimestamp(data: Data, token: Data) throws -> Data

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.

In NexPdf · Modul signatures · C nexpdf_add_signature_timestamp

ltvRequestsJson

static func ltvRequestsJson(data: Data, responsesJson: String? = nil) throws -> String

B-LT in Schritten: die HTTP-Anfragen (OCSP, CRL, Zertifikate), die die Validierungsdaten noch brauchen, angesichts der bisherigen Antworten; [], wenn nichts fehlt.

In NexPdf · Modul signatures · C nexpdf_ltv_requests_json

addLtvWithResponses

static func addLtvWithResponses(data: Data, responsesJson: String? = nil) throws -> Data

B-LT in Schritten: fügt das /DSS aus den abgerufenen Antworten als inkrementelles Update hinzu (fehlende gelten als fehlgeschlagen) und gibt das PDF zurück.

In NexPdf · Modul signatures · C nexpdf_add_ltv_with_responses

validateLtaJson

static func validateLtaJson(data: Data, trustRootsPem: String? = nil) throws -> String

Vollständige PAdES-B-LTA-Validierung: ob das /DSS jeder zeitgestempelten Revision jedes Zertifikat und jeden geprüften OCSP- oder CRL-Eintrag enthält, den die früheren Signaturen und Zeitstempel brauchen. Gibt complete und timestamps mit ihren issues zurück.

In NexPdf · Modul signatures · C nexpdf_validate_lta_json

PDF/A, PDF/X und PDF/UA

convertPdfa

func convertPdfa() throws -> Int32

Konvertiert das Dokument für die Archivierung in PDF/A (ISO 19005).

In NexPdfDocument · Modul standards · C nexpdf_convert_pdfa

convertPdfx

func convertPdfx() throws -> Int32

Konvertiert das Dokument für den Druckaustausch in PDF/X.

In NexPdfDocument · Modul standards · C nexpdf_convert_pdfx

autoTag

func autoTag(lang: String?, force: Int32) throws -> String

Taggt das Dokument für Barrierefreiheit (PDF/UA-Strukturbaum, Sprache, Titel, Metadaten). lang ist ein BCP-47-Tag (Standard en-US); force taggt ein bereits getaggtes Dokument erneut. Gibt einen JSON-Bericht zurück.

In NexPdfDocument · Modul standards · C nexpdf_auto_tag

validatePdfaJson

func validatePdfaJson(level: String? = nil) throws -> String

Regelbasierte PDF/A-Validierung für 1a bis 4f (die angegebene Stufe, oder 2b, wenn leer): compliant, level und failures mit clause, message, page und object.

In NexPdfDocument · Modul standards · C nexpdf_validate_pdfa_json

validatePdfuaJson

func validatePdfuaJson() throws -> String

PDF/UA-Validierung (PDF/UA-1, oder PDF/UA-2, wenn angegeben), mit demselben Bericht wie die PDF/A-Validierung.

In NexPdfDocument · Modul standards · C nexpdf_validate_pdfua_json

convertPdfaLevel

func convertPdfaLevel(level: String? = nil) throws -> Int32

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.

In NexPdfDocument · Modul standards · C nexpdf_convert_pdfa_level

convertPdfaJson

func convertPdfaJson(level: String?, flattenDpi: Double, substituteFonts: Int32) throws -> 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, in der die Transparenz von PDF/A-1 verflacht wird (300 bei 0 oder weniger); substitute_fonts 0 lässt nicht eingebettete Schriftarten unverändert.

In NexPdfDocument · Modul standards · C nexpdf_convert_pdfa_json

convertPdfuaJson

func convertPdfuaJson(part: Int32, lang: String? = nil) throws -> String

Konvertiert in PDF/UA-1 oder PDF/UA-2 (Teil 1 oder 2): taggt ein ungetaggtes Dokument, bettet Schriftarten ein und verwendet für Teil 2 die PDF-2.0-Namespaces. lang (en-US, wenn leer) gilt, wenn das Dokument keine hat. Gibt profile, compliant, fixed, warnings, substitutions, remaining zurück.

In NexPdfDocument · Modul standards · C nexpdf_convert_pdfua_json

validatePdfuaPartJson

func validatePdfuaPartJson(part: Int32) throws -> String

Validiert gegen PDF/UA-1 oder PDF/UA-2 (Teil 1 oder 2), unabhängig davon, was das Dokument angibt, mit demselben Bericht wie die PDF/UA-Validierung.

In NexPdfDocument · Modul standards · C nexpdf_validate_pdfua_part_json

registerSubstituteFont

static func registerSubstituteFont(data: Data) throws -> String

Registriert TrueType-Schriftartdaten für den Schriftartersatz bei PDF/A und PDF/UA: Nicht eingebettete Schriftarten mit demselben PostScript- oder Familiennamen verwenden sie. Gibt den PostScript-Namen zurück, oder nichts, wenn die Daten keine TrueType-Schriftart mit glyf-Umrissen sind.

In NexPdf · Modul standards · C nexpdf_register_substitute_font

OCR

ocr

func ocr(optionsJson: String? = nil) throws -> String

Erkennt gescannte Seiten und fügt eine unsichtbare, durchsuchbare Textebene hinzu. Optionen (dürfen fehlen): {"engine":"auto|builtin|tesseract|neural","languages":"por+eng","dpi":300,"pages":[0],"force":false}. Gibt einen JSON-Bericht zurück.

In NexPdfDocument · Modul ocr · C nexpdf_ocr

ocrLoadModel

static func ocrLoadModel(optionsJson: String?, model: Data, dictionary: String? = nil) throws -> Int32

Lädt zur Laufzeit ein neuronales OCR-Modell (ONNX): {"kind":"detection"|"recognition"|"classification","languages","name","input_height","max_side"}; ein Erkennungsmodell braucht sein Zeichenwörterbuch, ein Detection-Modell oder ein Textrichtungs-Klassifikator (0°/180°) braucht keines.

In NexPdf · Modul ocr · C nexpdf_ocr_load_model

ocrModelsJson

static func ocrModelsJson() throws -> String

Die geladenen OCR-Modelle: kind, name, languages, symbols, size.

In NexPdf · Modul ocr · C nexpdf_ocr_models_json

ocrUnloadModels

static func ocrUnloadModels(languages: String? = nil) throws -> Int32

Entlädt die OCR-Modelle der angegebenen Sprachen (alle, wenn leer). Gibt die Anzahl der entfernten zurück.

In NexPdf · Modul ocr · C nexpdf_ocr_unload_models

Vergleichen, optimieren und Speicher

compareJson

func compareJson(b: NexPdfDocument, dpi: Double) throws -> String

Vergleicht zwei Dokumente (Text- und visuelle Unterschiede pro Seite) in der angegebenen Auflösung, als JSON.

In NexPdfDocument · immer verfügbar · C nexpdf_compare_json

compareOverlayPng

func compareOverlayPng(b: NexPdfDocument, pageIndex: Int, dpi: Double) throws -> Data

Ein PNG-Overlay der visuellen Unterschiede einer Seite zweier Dokumente.

In NexPdfDocument · immer verfügbar · C nexpdf_compare_overlay_png

optimize

func optimize() throws -> String

Optimiert das Dokument (entfernt unbenutzte Objekte, komprimiert Streams neu); gibt einen JSON-Bericht zurück.

In NexPdfDocument · Modul editor · C nexpdf_optimize

subsetFonts

func subsetFonts() throws -> String

Bildet Subsets der eingebetteten Schriftarten aus den vom Dokument verwendeten Glyphen; gibt einen JSON-Bericht zurück.

In NexPdfDocument · Modul editor · C nexpdf_subset_fonts

trimMemory

func trimMemory() -> Int

Verwirft zwischengespeicherte Daten des Dokuments; gibt die freigegebenen Bytes zurück.

In NexPdfDocument · immer verfügbar · C nexpdf_trim_memory

memoryUsageBytes

func memoryUsageBytes() -> Int

Ungefährer vom Dokument belegter Speicher, in Bytes.

In NexPdfDocument · immer verfügbar · C nexpdf_memory_usage_bytes

compareTextJson

func compareTextJson(b: NexPdfDocument, optionsJson: String? = nil) throws -> String

Wortgenauer 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"}.

In NexPdfDocument · immer verfügbar · C nexpdf_compare_text_json

compareAnnotate

func compareAnnotate(b: NexPdfDocument, optionsJson: String? = nil) throws -> Data

Der 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.

In NexPdfDocument · immer verfügbar · C nexpdf_compare_annotate

Sonstiges

setAnnotationFlags

func setAnnotationFlags(num: UInt32, generation: UInt16, flagsJson: String? = nil) throws -> Int32

In NexPdfDocument

setAnnotationStyle

func setAnnotationStyle(num: UInt32, generation: UInt16, styleJson: String? = nil) throws -> Int32

In NexPdfDocument

Auf dieser Seite

Einrichtung und LebenszyklusmessageisLicenseerrorDescriptiondescriptionversionactivateLicenselicenseStatusisLicensedjsonopenpagespageSizecopywriteBibliothek und LizenzierungregisterStandardFonthasBundledFontsÖffnen und SpeichernopenBytesWithPasswordfromHtmlopenOfficeopenEbookopenImagesaveBytessaveLinearizedSeiten und RenderingpageCountpageWidthpageHeightpageViewJsonrenderPagePngrenderThumbPngsetOverprintText, Suche und AssistentextractPageTextextractMarkdownsearchJsonpageBlocksJsonaskDocumentpageWordsJsonKonvertierungtoHtmltoJsontoXmltoCsvtoRtftoDocxtoXlsxtoPptxtoReflowHtmlopenXlsxWithClockopenDocxWithOptionsJsonVorlagentemplateDocxToPdftemplateDocxFilltemplateHtmlToPdftemplateFillPdftemplateDocxFillWithOffice-BearbeitungxlsxEditxlsxCellsJsondocxEditdocxParagraphsJsonStrukturierte Extraktion und BarcodesextractTablesJsonextractKeyValuesJsonextractionPromptJsonextractionValidateJsonclassifyDocumentJsonreadBarcodesJsonreadBarcodesImageJsonaddBarcodeaddBarcodeExAnnotationenaddAnnotationaddInkaddLineannotationsJsonremoveAnnotationmoveAnnotationsetAnnotationContentsexportXfdfimportXfdfflattenAnnotationsaddImageStampaddMeasurementmeasurementsJsonaddFileAttachmentAnnotaddInkSignaturereplyToAnnotationannotationRepliesJsonsetAnnotationStateFormulareformFieldsJsonfillFormFieldsetSignatureAppearanceaddFormFieldflattenFormsrecalculateFormsexportFormJsonimportFormJsonexportFormFdfimportFormFdfexportFormXfdfimportFormXfdfXFA-FormularexfaInfoJsonxfaExportDataxfaImportDataxfaToAcroformxfaFlattenxfaRemovexfaToAcroformJsonxfaRunScriptsJsonregisterFallbackFontEchtzeit-ZusammenarbeitsyncExportJsonsyncExportLocalJsonsyncApplyJsonsyncSnapshotJsonsyncSetClientIdSeitenbearbeitungrotatePagedeletePageduplicatePageaddBlankPagereversePagesmovePagecropPageextractPagesappendDocumentinsertImagePagessetPageBackgroundremovePageBackgroundInhaltsbearbeitungpageContentJsoneditTextaddPageTextdeleteContenttransformImagereplaceImageeditTextBlockMetadaten, Lesezeichen, Ebenen und AnhängemetadataJsonsetMetadataoutlinesJsonsetOutlinesJsonpageLabelsJsonsetPageLabelsJsonlayersJsonsetLayerVisibleattachmentsJsonattachmentDataaddAttachmentremoveAttachmentVerschlüsselung, Wasserzeichen und StempelencryptAes256encryptWithPermissionssecurityJsonremovePasswordaddWatermarkremoveWatermarksaddHeaderFooteraddBatesSchwärzungapplyRedactionredactMatchesDigitale SignaturensignPadessignPkcs12pkcs12InfoJsonprepareExternalSignatureexternalSignatureDatacompleteExternalSignatureverifySignaturesJsonverifySignaturesWithRootsJsonaddLtvaddDocumentTimestampaddDocumentTimestampBytesprepareDocumentTimestampdocumentTimestampRequestcompleteDocumentTimestampsignatureTimestampRequestaddSignatureTimestampltvRequestsJsonaddLtvWithResponsesvalidateLtaJsonPDF/A, PDF/X und PDF/UAconvertPdfaconvertPdfxautoTagvalidatePdfaJsonvalidatePdfuaJsonconvertPdfaLevelconvertPdfaJsonconvertPdfuaJsonvalidatePdfuaPartJsonregisterSubstituteFontOCRocrocrLoadModelocrModelsJsonocrUnloadModelsVergleichen, optimieren und SpeichercompareJsoncompareOverlayPngoptimizesubsetFontstrimMemorymemoryUsageBytescompareTextJsoncompareAnnotateSonstigessetAnnotationFlagssetAnnotationStyle