Zum Inhalt springen
NexPDF

API-Referenz

Jede Klasse, Methode und Funktion des NexPDF-Go-SDK, nach Funktion gruppiert. Erzeugt aus NexPDF 1.1.0.

Deutsch

Erzeugt aus NexPDF 1.1.0

Diese Seite wird aus den Quellen von github.com/nexdevit/nexpdf-go erzeugt. Sie listet 190 Mitglieder 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

Error

type Error struct { Message string; Code int32 }

Der Fehler, den jeder Aufruf liefert: die Meldung der Engine und, von ActivateLicense, der negative Lizenzcode.

Auf package nexpdf

Version

func Version() string

Version liefert die Version der Engine.

Auf package nexpdf

ActivateLicense

func ActivateLicense(keyOrXML, platform, appID string) (int32, error)

ActivateLicense aktiviert einen Lizenzschlüssel oder eine license.xml einmal pro Prozess. Es liefert 2 (lizenziert) oder 1 (Test); andere Ergebnisse werden als *Error mit dem negativen Code zurückgegeben. Ohne Lizenz ist das SDK im Nur-Ansicht-Modus, und gerenderte Seiten tragen ein Wasserzeichen.

Auf package nexpdf

IsLicensed

func IsLicensed(module string) bool

IsLicensed meldet, ob die aktive Lizenz das Modul freischaltet (annotations, forms, editor, security, redaction, signatures, conversion, ocr, standards).

Auf package nexpdf

OpenBytes

func OpenBytes(data []byte, password ...string) (*Document, error)

OpenBytes ö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 nicht leeres Passwort öffnet verschlüsselte Dateien.

Auf package nexpdf

Open

func Open(path string, password ...string) (*Document, error)

Open liest und öffnet eine Datei; siehe OpenBytes.

Auf package nexpdf

Close

func (d *Document) Close()

Close gibt das native Dokument frei. Es darf mehrfach aufgerufen werden.

Auf Document

Save

func (d *Document) Save(path string, linearized bool) error

Save schreibt das Dokument nach path; linearized schreibt eine „Fast Web View“-Datei.

Auf Document

Copy

func (d *Document) Copy() (*Document, error)

Copy liefert eine unabhängige Kopie (für Snapshots zum Rückgängigmachen oder für Arbeit in einer anderen Goroutine).

Auf Document

Bibliothek und Lizenzierung

LicenseStatusJSON

func LicenseStatusJSON() (string, error)

Die aktive Lizenz als JSON: state (unlicensed, trial oder licensed), licensee, id, tier, modules, expires_at, days_left und watermark.

Auf package nexpdf · immer verfügbar · C nexpdf_license_status_json

Invoke

func Invoke(requestJson string) (string, error)

Die gesamte API hinter einem JSON-Aufruf, für Brücken, die nur Strings weitergeben: {"fn":"to_xlsx","args":[handle]} liefert {"ok":true,"result":...} oder {"ok":false,"error":"..."}. Dokumente sind Handle-Nummern, Byte-Puffer sind Base64.

Auf package nexpdf · immer verfügbar · C nexpdf_invoke

RegisterStandardFont

func RegisterStandardFont(data []byte) (int32, error)

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

Auf package nexpdf · immer verfügbar · C nexpdf_register_standard_font

HasBundledFonts

func HasBundledFonts() (int32, error)

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

Auf package nexpdf · immer verfügbar · C nexpdf_has_bundled_fonts

Öffnen und Speichern

OpenBytesWithPassword

func OpenBytesWithPassword(data []byte, password string) (*Document, error)

Ö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 package nexpdf · immer verfügbar · C nexpdf_open_bytes_with_password

FromHTML

func FromHTML(html string) (*Document, error)

Layoutet HTML als neues PDF-Dokument.

Auf package nexpdf · Modul conversion · C nexpdf_from_html

OpenOffice

func OpenOffice(data []byte) (*Document, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_open_office

OpenEbook

func OpenEbook(data []byte) (*Document, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_open_ebook

OpenImage

func OpenImage(data []byte) (*Document, error)

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

Auf package nexpdf · immer verfügbar · C nexpdf_open_image

SaveBytes

func (d *Document) SaveBytes() ([]byte, error)

Das Dokument mit allen Änderungen als PDF-Bytes (vollständiges Neuschreiben).

Auf Document · immer verfügbar · C nexpdf_save_bytes

SaveLinearized

func (d *Document) SaveLinearized() ([]byte, error)

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

Auf Document · immer verfügbar · C nexpdf_save_linearized

Seiten und Rendering

PageCount

func (d *Document) PageCount() (int32, error)

Anzahl der Seiten.

Auf Document · immer verfügbar · C nexpdf_page_count

PageWidth

func (d *Document) PageWidth(pageIndex int) float64

Angezeigte Seitenbreite in Punkt (Beschnittrahmen, Drehung und /UserUnit angewendet).

Auf Document · immer verfügbar · C nexpdf_page_width

PageHeight

func (d *Document) PageHeight(pageIndex int) float64

Angezeigte Seitenhöhe in Punkt (Beschnittrahmen, Drehung und /UserUnit angewendet).

Auf Document · immer verfügbar · C nexpdf_page_height

PageViewJSON

func (d *Document) PageViewJSON(pageIndex int) (string, error)

Wie die Seite angezeigt wird: width, height, rotation, user_unit, crop und die Matrix to_display vom PDF- zum Anzeigeraum.

Auf Document · immer verfügbar · C nexpdf_page_view_json

RenderPagePNG

func (d *Document) RenderPagePNG(pageIndex int, dpi float64) ([]byte, error)

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

Auf Document · immer verfügbar · C nexpdf_render_page_png

RenderThumbPNG

func (d *Document) RenderThumbPNG(pageIndex int, maxDim uint32) ([]byte, error)

Rendert eine PNG-Miniaturansicht, deren längere Seite höchstens max_dim Pixel misst.

Auf Document · immer verfügbar · C nexpdf_render_thumb_png

SetOverprint

func (d *Document) SetOverprint(mode int32) (int32, error)

Ü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

ExtractPageText

func (d *Document) ExtractPageText(pageIndex int) (string, error)

Der Text einer Seite in Lesereihenfolge.

Auf Document · immer verfügbar · C nexpdf_extract_page_text

ExtractMarkdown

func (d *Document) ExtractMarkdown() (string, error)

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

Auf Document · immer verfügbar · C nexpdf_extract_markdown

SearchJSON

func (d *Document) SearchJSON(query string) (string, error)

Findet 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-Punkten.

Auf Document · immer verfügbar · C nexpdf_search_json

PageBlocksJSON

func (d *Document) PageBlocksJSON(pageIndex int) (string, error)

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

Auf Document · immer verfügbar · C nexpdf_page_blocks_json

AskDocument

func (d *Document) AskDocument(question string, k uint32, maxChars uint32) (string, error)

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

PageWordsJSON

func (d *Document) PageWordsJSON(pageIndex int, optionsJson string) (string, error)

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.

Auf Document · immer verfügbar · C nexpdf_page_words_json

Konvertierung

ToHTML

func (d *Document) ToHTML() (string, error)

Das Dokument als HTML.

Auf Document · Modul conversion · C nexpdf_to_html

ToJSON

func (d *Document) ToJSON() (string, error)

Der Dokumentinhalt als JSON.

Auf Document · Modul conversion · C nexpdf_to_json

ToXML

func (d *Document) ToXML() (string, error)

Der Dokumentinhalt als XML.

Auf Document · Modul conversion · C nexpdf_to_xml

ToCSV

func (d *Document) ToCSV() (string, error)

Tabellen des Dokuments als CSV.

Auf Document · Modul conversion · C nexpdf_to_csv

ToRTF

func (d *Document) ToRTF() (string, error)

Das Dokument als RTF.

Auf Document · Modul conversion · C nexpdf_to_rtf

ToDOCX

func (d *Document) ToDOCX() ([]byte, error)

Das Dokument als Word-Datei (.docx).

Auf Document · Modul conversion · C nexpdf_to_docx

ToXLSX

func (d *Document) ToXLSX() ([]byte, error)

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

Auf Document · Modul conversion · C nexpdf_to_xlsx

ToPPTX

func (d *Document) ToPPTX() ([]byte, error)

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

Auf Document · Modul conversion · C nexpdf_to_pptx

ToReflowHTML

func (d *Document) ToReflowHTML(optionsJson string) (string, error)

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

Auf Document · Modul conversion · C nexpdf_to_reflow_html

OpenXLSXWithClock

func OpenXLSXWithClock(data []byte, clockUnixSeconds float64) (*Document, error)

Konvertiert eine Excel-Arbeitsmappe mit fester Uhr: NOW() und TODAY() in Formeln ohne zwischengespeicherten Wert liefern die angegebene Unix-Zeit (Sekunden, ohne Zeitzone).

Auf package nexpdf · Modul conversion · C nexpdf_open_xlsx_with_clock

OpenDOCXWithOptionsJSON

func OpenDOCXWithOptionsJSON(data []byte, optionsJson string) (*Document, error)

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 package nexpdf · Modul conversion · C nexpdf_open_docx_with_options_json

Vorlagen

TemplateDOCXToPdf

func TemplateDOCXToPdf(templateBytes []byte, dataJson string, optionsJson string) (*Document, error)

Füllt eine Word-Vorlage mit JSON-Daten und konvertiert sie in ein neues PDF-Dokument. Optionen: {"strict":false,"locale":"en"}; mit strict lässt ein fehlendes Feld den Aufruf fehlschlagen.

Auf package nexpdf · Modul conversion · C nexpdf_template_docx_to_pdf

TemplateDOCXFill

func TemplateDOCXFill(templateBytes []byte, dataJson string) ([]byte, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_template_docx_fill

TemplateHTMLToPdf

func TemplateHTMLToPdf(htmlUtf8 string, dataJson string, optionsJson string) (*Document, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_template_html_to_pdf

TemplateFillPdf

func (d *Document) TemplateFillPdf(dataJson string, optionsJson string) (int32, error)

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

TemplateDOCXFillWith

func TemplateDOCXFillWith(templateBytes []byte, dataJson string, optionsJson string) ([]byte, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_template_docx_fill_with

Office-Bearbeitung

XLSXEdit

func XLSXEdit(data []byte, editsJson string) ([]byte, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_xlsx_edit

XLSXCellsJSON

func XLSXCellsJSON(data []byte, optionsJson string) (string, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_xlsx_cells_json

DOCXEdit

func DOCXEdit(data []byte, opsJson string) ([]byte, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_docx_edit

DOCXParagraphsJSON

func DOCXParagraphsJSON(data []byte) (string, error)

Die Absätze eines Word-Dokuments als JSON: Index, Format, Text und ob sich jeder in einer Tabelle befindet.

Auf package nexpdf · Modul conversion · C nexpdf_docx_paragraphs_json

Strukturierte Extraktion und Barcodes

ExtractTablesJSON

func (d *Document) ExtractTablesJSON(pageIndex int32, optionsJson string) (string, error)

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

Auf Document · Modul conversion · C nexpdf_extract_tables_json

ExtractKeyValuesJSON

func (d *Document) ExtractKeyValuesJSON(optionsJson string) (string, error)

Label-Wert-Paare aus dem Layout und typisierte Entitäten (Datumsangaben, Beträge, IBANs, E-Mail-Adressen, Telefonnummern, Umsatzsteuer-Identifikationsnummern) mit normalisierten Werten. Optionen {"pages","date_order"}.

Auf Document · Modul conversion · C nexpdf_extract_key_values_json

ExtractionPromptJSON

func (d *Document) ExtractionPromptJSON(schemaJson string, optionsJson string) (string, error)

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

Auf Document · Modul conversion · C nexpdf_extraction_prompt_json

ExtractionValidateJSON

func (d *Document) ExtractionValidateJSON(schemaJson string, answerJson string) (string, error)

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

Auf Document · Modul conversion · C nexpdf_extraction_validate_json

ClassifyDocumentJSON

func (d *Document) ClassifyDocumentJSON(labelsJson string) (string, error)

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

Auf Document · Modul conversion · C nexpdf_classify_document_json

ReadBarcodesJSON

func (d *Document) ReadBarcodesJSON(pageIndex int32, optionsJson string) (string, error)

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

Auf Document · Modul conversion · C nexpdf_read_barcodes_json

ReadBarcodesImageJSON

func ReadBarcodesImageJSON(data []byte, optionsJson string) (string, error)

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

Auf package nexpdf · Modul conversion · C nexpdf_read_barcodes_image_json

AddBarcode

func (d *Document) AddBarcode(pageIndex int, llx float64, lly float64, urx float64, ury float64, format string, text string) (int32, error)

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

Auf Document · Modul editor · C nexpdf_add_barcode

AddBarcodeEx

func (d *Document) AddBarcodeEx(pageIndex int, llx float64, lly float64, urx float64, ury float64, format string, text string, optionsJson string) (int32, error)

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

AddAnnotation

func (d *Document) AddAnnotation(pageIndex int, kind string, colorHex string, opacity float64, contents string, llx float64, lly float64, urx float64, ury float64) (int32, error)

Fügt eine Annotation hinzu. kind ist ein PDF-Annotationssubtyp wie Highlight, Underline, StrikeOut, Squiggly, Square, Circle, FreeText oder Text; Textmarkierungen werden an die Zeilen unter dem Rechteck angepasst. Die Farbe ist #RRGGBB, das Rechteck in PDF-Punkten.

Auf Document · Modul annotations · C nexpdf_add_annotation

AddInk

func (d *Document) AddInk(pageIndex int, colorHex string, strokeWidth float64, opacity float64, coords string) (int32, error)

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

Auf Document · Modul annotations · C nexpdf_add_ink

AddLine

func (d *Document) AddLine(pageIndex int, kind string, colorHex string, opacity float64, strokeWidth float64, x1 float64, y1 float64, x2 float64, y2 float64) (int32, error)

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

Auf Document · Modul annotations · C nexpdf_add_line

AnnotationsJSON

func (d *Document) AnnotationsJSON(pageIndex int) (string, error)

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

Auf Document · immer verfügbar · C nexpdf_annotations_json

RemoveAnnotation

func (d *Document) RemoveAnnotation(pageIndex int, num uint32, generation uint16) (int32, error)

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

Auf Document · Modul annotations · C nexpdf_remove_annotation

MoveAnnotation

func (d *Document) MoveAnnotation(num uint32, generation uint16, dx float64, dy float64) (int32, error)

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

Auf Document · Modul annotations · C nexpdf_move_annotation

SetAnnotationContents

func (d *Document) SetAnnotationContents(num uint32, generation uint16, contents string) (int32, error)

Ersetzt den Textinhalt einer Annotation.

Auf Document · Modul annotations · C nexpdf_set_annotation_contents

ExportXFDF

func (d *Document) ExportXFDF() (string, error)

Exportiert jede Annotation als XFDF-Dokument.

Auf Document · Modul annotations · C nexpdf_export_xfdf

ImportXFDF

func (d *Document) ImportXFDF(xfdf string) (int32, error)

Importiert Annotationen aus einem XFDF-Dokument.

Auf Document · Modul annotations · C nexpdf_import_xfdf

FlattenAnnotations

func (d *Document) FlattenAnnotations(pageIndex int32) (int32, error)

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

Auf Document · Modul annotations · C nexpdf_flatten_annotations

AddImageStamp

func (d *Document) AddImageStamp(page int, llx float64, lly float64, urx float64, ury float64, rgba []byte, width uint32, height uint32, opacity float64) (int32, error)

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

Auf Document · Modul annotations · C nexpdf_add_image_stamp

AddMeasurement

func (d *Document) AddMeasurement(page int, json string) (string, error)

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

MeasurementsJSON

func (d *Document) MeasurementsJSON() (string, error)

Die gespeicherten Messungen als JSON.

Auf Document · immer verfügbar · C nexpdf_measurements_json

AddFileAttachmentAnnot

func (d *Document) AddFileAttachmentAnnot(pageIndex int, x float64, y float64, name string, data []byte, mime string, description string) (int32, error)

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

Auf Document · Modul annotations · C nexpdf_add_file_attachment_annot

AddInkSignature

func (d *Document) AddInkSignature(pageIndex int, colorHex string, strokeWidth float64, strokes string) (int32, error)

Fügt eine handschriftliche Signatur hinzu: eine Freihand-Annotation mit mehreren Strichen ("x,y;x,y|x,y;x,y", PDF-Punkte) und dem Betreff „Signature“. Nur visuell; für eine kryptografische Signatur verwenden Sie eine PAdES-Signatur.

Auf Document · Modul annotations · C nexpdf_add_ink_signature

ReplyToAnnotation

func (d *Document) ReplyToAnnotation(pageIndex int, num uint32, generation uint16, author string, text string) (int32, error)

Fügt eine Antwort von author zu einer Annotation (oder zu einer anderen Antwort) hinzu. Liefert die Objektnummer der Antwort (Generation 0).

Auf Document · Modul annotations · C nexpdf_reply_to_annotation

AnnotationRepliesJSON

func (d *Document) AnnotationRepliesJSON(pageIndex int, num uint32, generation uint16) (string, error)

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

Auf Document · Modul annotations · C nexpdf_annotation_replies_json

SetAnnotationState

func (d *Document) SetAnnotationState(pageIndex int, num uint32, generation uint16, author string, state string) (int32, error)

Setzt einen Prüfstatus (Accepted, Rejected, Cancelled, Completed, None) oder markierten Status (Marked, Unmarked) als versteckte Statusantwort. Liefert ihre Objektnummer.

Auf Document · Modul annotations · C nexpdf_set_annotation_state

Formulare

FormFieldsJSON

func (d *Document) FormFieldsJSON() (string, error)

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

Auf Document · Modul forms · C nexpdf_form_fields_json

FillFormField

func (d *Document) FillFormField(name string, value string) (int32, error)

Setzt einen Feldwert wie ein Viewer: Die Keystroke- und Validate-Skripte prüfen den Wert, danach wird jedes berechnete Feld neu berechnet. Kontrollkästchen nehmen "true" oder "false", Listenfelder den Optionstext.

Auf Document · Modul forms · C nexpdf_fill_form_field

SetSignatureAppearance

func (d *Document) SetSignatureAppearance(name string, rgba []byte, width uint32, height uint32) (int32, error)

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

Auf Document · Modul forms · C nexpdf_set_signature_appearance

AddFormField

func (d *Document) AddFormField(pageIndex int, kind string, name string, llx float64, lly float64, urx float64, ury float64) (int32, error)

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

FlattenForms

func (d *Document) FlattenForms() (int32, error)

Brennt die Formularfelder in den Seiteninhalt ein.

Auf Document · Modul forms · C nexpdf_flatten_forms

RecalculateForms

func (d *Document) RecalculateForms() (int32, error)

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

Auf Document · Modul forms · C nexpdf_recalculate_forms

ExportFormJSON

func (d *Document) ExportFormJSON() (string, error)

Die Feldwerte als JSON-Objekt.

Auf Document · Modul forms · C nexpdf_export_form_json

ImportFormJSON

func (d *Document) ImportFormJSON(json string) (int32, error)

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

Auf Document · Modul forms · C nexpdf_import_form_json

ExportFormFDF

func (d *Document) ExportFormFDF(pdfName string) ([]byte, error)

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

Auf Document · Modul forms · C nexpdf_export_form_fdf

ImportFormFDF

func (d *Document) ImportFormFDF(data []byte) (int32, error)

Füllt Felder aus einer FDF-Datei.

Auf Document · Modul forms · C nexpdf_import_form_fdf

ExportFormXFDF

func (d *Document) ExportFormXFDF(pdfName string) (string, error)

Die Feldwerte als XFDF.

Auf Document · Modul forms · C nexpdf_export_form_xfdf

ImportFormXFDF

func (d *Document) ImportFormXFDF(xfdf string) (int32, error)

Füllt Felder aus XFDF.

Auf Document · Modul forms · C nexpdf_import_form_xfdf

XFA-Formulare

XfaInfoJSON

func (d *Document) XfaInfoJSON() (string, error)

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

Auf Document · Modul forms · C nexpdf_xfa_info_json

XfaExportData

func (d *Document) XfaExportData(format string) (string, error)

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

Auf Document · Modul forms · C nexpdf_xfa_export_data

XfaImportData

func (d *Document) XfaImportData(data string, format string) (int32, error)

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

XfaToAcroform

func (d *Document) XfaToAcroform() (int32, error)

Konvertiert in ein einfaches AcroForm-PDF und entfernt XFA; dynamische Formulare werden zu neuen Seiten gelayoutet, zuvor laufen die Skripte. Textfelder behalten ihren formatierten Anzeigewert als /V. Liefert die Anzahl der AcroForm-Felder.

Auf Document · Modul forms · C nexpdf_xfa_to_acroform

XfaFlatten

func (d *Document) XfaFlatten() (int32, error)

Konvertiert und verflacht das XFA-Formular: ein einfaches PDF mit den gezeichneten Werten. Liefert die Anzahl der verflachten Widgets.

Auf Document · Modul forms · C nexpdf_xfa_flatten

XfaRemove

func (d *Document) XfaRemove() (int32, error)

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

Auf Document · Modul forms · C nexpdf_xfa_remove

XfaToAcroformJSON

func (d *Document) XfaToAcroformJSON(optionsJson string) (string, error)

Konvertiert mit den Optionen {"scripts":true,"flatten":false} in AcroForm 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

XfaRunScriptsJSON

func (d *Document) XfaRunScriptsJSON() (string, error)

Führt die Skripte initialize, calculate und validate aus (FormCalc und JavaScript) und speichert berechnete Werte in den Daten: data_changed, warnings, validation_errors.

Auf Document · Modul forms · C nexpdf_xfa_run_scripts_json

RegisterFallbackFont

func RegisterFallbackFont(data []byte) (int32, error)

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

Auf package nexpdf · Modul forms · C nexpdf_register_fallback_font

Zusammenarbeit in Echtzeit

SyncExportJSON

func (d *Document) SyncExportJSON(sinceVersion uint64) (string, error)

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

SyncExportLocalJSON

func (d *Document) SyncExportLocalJSON(sinceVersion uint64) (string, error)

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

SyncApplyJSON

func (d *Document) SyncApplyJSON(changesJson string) (string, error)

NexPDF Sync: wendet entfernte Änderungen an, pro Datensatz gewinnt der letzte Schreibende. Liefert ok, clock, applied, ignored, conflicts und errors.

Auf Document · Modul annotations · C nexpdf_sync_apply_json

SyncSnapshotJSON

func (d *Document) SyncSnapshotJSON() (string, error)

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

Auf Document · Modul annotations · C nexpdf_sync_snapshot_json

SyncSetClientId

func (d *Document) SyncSetClientId(clientId string) (int32, error)

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

RotatePage

func (d *Document) RotatePage(pageIndex int, degrees int32) (int32, error)

Dreht eine Seite um ein Vielfaches von 90 Grad.

Auf Document · Modul editor · C nexpdf_rotate_page

DeletePage

func (d *Document) DeletePage(pageIndex int) (int32, error)

Löscht eine Seite.

Auf Document · Modul editor · C nexpdf_delete_page

DuplicatePage

func (d *Document) DuplicatePage(pageIndex int) (int32, error)

Fügt eine Kopie einer Seite hinter ihr ein.

Auf Document · Modul editor · C nexpdf_duplicate_page

AddBlankPage

func (d *Document) AddBlankPage() (int32, error)

Hängt eine leere Seite an.

Auf Document · Modul editor · C nexpdf_add_blank_page

ReversePages

func (d *Document) ReversePages() (int32, error)

Kehrt die Seitenreihenfolge um.

Auf Document · Modul editor · C nexpdf_reverse_pages

MovePage

func (d *Document) MovePage(from int, to int) (int32, error)

Verschiebt die Seite bei from an den Index to.

Auf Document · Modul editor · C nexpdf_move_page

CropPage

func (d *Document) CropPage(pageIndex int, llx float64, lly float64, urx float64, ury float64) (int32, error)

Setzt den Beschnittrahmen einer Seite (PDF-Punkte).

Auf Document · Modul editor · C nexpdf_crop_page

ExtractPages

func (d *Document) ExtractPages(indices []uint32) (*Document, error)

Ein neues Dokument aus den angegebenen Seiten (Teilen).

Auf Document · Modul editor · C nexpdf_extract_pages

AppendDocument

func (d *Document) AppendDocument(other *Document) (int32, error)

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

Auf Document · Modul editor · C nexpdf_append_document

InsertImagePages

func (d *Document) InsertImagePages(index int, data []byte) (int32, error)

Fügt die Bilder einer JPEG-, PNG- oder TIFF-Datei als Seiten vor index ein (wird begrenzt; die Seitenanzahl hängt an). Liefert die Anzahl der hinzugefügten Seiten.

Auf Document · immer verfügbar · C nexpdf_insert_image_pages

SetPageBackground

func (d *Document) SetPageBackground(optionsJson string, rgb []byte, width uint32, height uint32) (int32, error)

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

RemovePageBackground

func (d *Document) RemovePageBackground(pagesJson string) (int32, error)

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

PageContentJSON

func (d *Document) PageContentJSON(page int) (string, error)

Die Textzeilen und Bilder einer Seite als JSON: id, kind (text oder image), text, rect, size, color, font, family, bold, italic. IDs bleiben bis zur nächsten Bearbeitung dieser Seite gültig.

Auf Document · Modul editor · C nexpdf_page_content_json

EditText

func (d *Document) EditText(page int, id string, changeJson string) (int32, error)

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

Auf Document · Modul editor · C nexpdf_edit_text

AddPageText

func (d *Document) AddPageText(page int, json string) (int32, error)

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

Auf Document · Modul editor · C nexpdf_add_page_text

DeleteContent

func (d *Document) DeleteContent(page int, id string) (int32, error)

Löscht eine Textzeile oder ein Bild aus dem Seiteninhalt.

Auf Document · Modul editor · C nexpdf_delete_content

TransformImage

func (d *Document) TransformImage(page int, id string, llx float64, lly float64, urx float64, ury float64) (int32, error)

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

Auf Document · Modul editor · C nexpdf_transform_image

ReplaceImage

func (d *Document) ReplaceImage(page int, id string, rgb []byte, width uint32, height uint32) (int32, error)

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

Auf Document · Modul editor · C nexpdf_replace_image

EditTextBlock

func (d *Document) EditTextBlock(pageIndex int, text string, colorHex string, fontSize float64, bold int32, italic int32, replaceExisting int32, llx float64, lly float64, urx float64, ury float64) (int32, error)

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

Auf Document · Modul editor · C nexpdf_edit_text_block

Metadaten, Lesezeichen, Ebenen und Anhänge

MetadataJSON

func (d *Document) MetadataJSON() (string, error)

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

Auf Document · immer verfügbar · C nexpdf_metadata_json

SetMetadata

func (d *Document) SetMetadata(title string, author string, subject string, keywords string) (int32, error)

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

Auf Document · Modul editor · C nexpdf_set_metadata

OutlinesJSON

func (d *Document) OutlinesJSON() (string, error)

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

Auf Document · immer verfügbar · C nexpdf_outlines_json

SetOutlinesJSON

func (d *Document) SetOutlinesJSON(json string) (int32, error)

Ersetzt die Lesezeichen durch einen JSON-Baum derselben Form.

Auf Document · Modul editor · C nexpdf_set_outlines_json

PageLabelsJSON

func (d *Document) PageLabelsJSON() (string, error)

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

Auf Document · immer verfügbar · C nexpdf_page_labels_json

SetPageLabelsJSON

func (d *Document) SetPageLabelsJSON(json string) (int32, error)

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

LayersJSON

func (d *Document) LayersJSON() (string, error)

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

Auf Document · immer verfügbar · C nexpdf_layers_json

SetLayerVisible

func (d *Document) SetLayerVisible(num uint32, generation uint16, visible int32) (int32, error)

Blendet eine Ebene ein oder aus.

Auf Document · immer verfügbar · C nexpdf_set_layer_visible

AttachmentsJSON

func (d *Document) AttachmentsJSON() (string, error)

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

Auf Document · immer verfügbar · C nexpdf_attachments_json

AttachmentData

func (d *Document) AttachmentData(name string) ([]byte, error)

Die Bytes einer eingebetteten Datei.

Auf Document · immer verfügbar · C nexpdf_attachment_data

AddAttachment

func (d *Document) AddAttachment(name string, data []byte, mime string, description string) (int32, error)

Bettet eine Datei auf Dokumentebene ein.

Auf Document · Modul editor · C nexpdf_add_attachment

RemoveAttachment

func (d *Document) RemoveAttachment(name string) (int32, error)

Entfernt eine eingebettete Datei.

Auf Document · Modul editor · C nexpdf_remove_attachment

Verschlüsselung, Wasserzeichen und Stempel

EncryptAES256

func (d *Document) EncryptAES256(userPw string, ownerPw string) (int32, error)

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

Auf Document · Modul security · C nexpdf_encrypt_aes256

EncryptWithPermissions

func (d *Document) EncryptWithPermissions(userPw string, ownerPw string, permissions uint32) (int32, error)

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

SecurityJSON

func (d *Document) SecurityJSON() (string, error)

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

Auf Document · immer verfügbar · C nexpdf_security_json

RemovePassword

func (d *Document) RemovePassword(password string) (int32, error)

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

AddWatermark

func (d *Document) AddWatermark(text string) (int32, error)

Bringt auf jeder Seite ein Textwasserzeichen an.

Auf Document · Modul security · C nexpdf_add_watermark

RemoveWatermarks

func (d *Document) RemoveWatermarks() (int32, error)

Entfernt die von NexPDF hinzugefügten Wasserzeichen.

Auf Document · Modul security · C nexpdf_remove_watermarks

AddHeaderFooter

func (d *Document) AddHeaderFooter(header string, footer string, fontSize float64) (int32, error)

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

AddBates

func (d *Document) AddBates(prefix string, start uint64, digits uint32) (int32, error)

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

Auf Document · Modul security · C nexpdf_add_bates

Schwärzung

ApplyRedaction

func (d *Document) ApplyRedaction(pageIndex int, llx float64, lly float64, urx float64, ury float64, fillWhite int32) (int32, error)

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

Auf Document · Modul redaction · C nexpdf_apply_redaction

RedactMatches

func (d *Document) RedactMatches(query string, mode int32, fillWhite int32) (int32, error)

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

SignPAdES

func (d *Document) SignPAdES(signer string, reason string, location string) ([]byte, error)

Signiert 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

SignPKCS12

func (d *Document) SignPKCS12(p12 []byte, password string, optionsJson string) ([]byte, error)

Signiert 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

PKCS12InfoJSON

func PKCS12InfoJSON(data []byte, password string) (string, error)

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

Auf package nexpdf · Modul signatures · C nexpdf_pkcs12_info_json

PrepareExternalSignature

func (d *Document) PrepareExternalSignature(cert []byte, optionsJson string) ([]byte, error)

Externes Signieren (HSM, Smartcard, Cloud-KMS), Schritt 1: ein PDF mit leerer 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

ExternalSignatureData

func ExternalSignatureData(prepared []byte, cert []byte) ([]byte, error)

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

Auf package nexpdf · Modul signatures · C nexpdf_external_signature_data

CompleteExternalSignature

func CompleteExternalSignature(prepared []byte, cert []byte, signature []byte, algorithm int32, optionsJson string) ([]byte, error)

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 package nexpdf · Modul signatures · C nexpdf_complete_external_signature

VerifySignaturesJSON

func VerifySignaturesJSON(data []byte) (string, error)

Verifiziert jede Signatur einer signierten Datei (ihre exakten Bytes). Jeder Eintrag enthält field, signer, subject, digest_ok, signature_ok, covers_whole_document, reason, signing_time, timestamp_ok, chain_ok, trusted, revocation, ltv, level und mehr.

Auf package nexpdf · immer verfügbar · C nexpdf_verify_signatures_json

VerifySignaturesWithRootsJSON

func VerifySignaturesWithRootsJSON(data []byte, rootsPem string) (string, error)

Verifiziert die Signaturen und behandelt die PEM-Zertifikate in roots_pem als Vertrauensanker.

Auf package nexpdf · Modul signatures · C nexpdf_verify_signatures_with_roots_json

AddLTV

func AddLTV(data []byte) ([]byte, error)

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

Auf package nexpdf · Modul signatures · C nexpdf_add_ltv

AddDocumentTimestamp

func (d *Document) AddDocumentTimestamp(optionsJson string) ([]byte, error)

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

Auf Document · Modul signatures · C nexpdf_add_document_timestamp

AddDocumentTimestampBytes

func AddDocumentTimestampBytes(data []byte, optionsJson string) ([]byte, error)

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

Auf package nexpdf · Modul signatures · C nexpdf_add_document_timestamp_bytes

PrepareDocumentTimestamp

func (d *Document) PrepareDocumentTimestamp(optionsJson string) ([]byte, error)

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

Auf Document · Modul signatures · C nexpdf_prepare_document_timestamp

DocumentTimestampRequest

func DocumentTimestampRequest(prepared []byte, hash string) ([]byte, error)

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

Auf package nexpdf · Modul signatures · C nexpdf_document_timestamp_request

CompleteDocumentTimestamp

func CompleteDocumentTimestamp(prepared []byte, token []byte) ([]byte, error)

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

Auf package nexpdf · Modul signatures · C nexpdf_complete_document_timestamp

SignatureTimestampRequest

func SignatureTimestampRequest(data []byte, hash string) ([]byte, error)

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.

Auf package nexpdf · Modul signatures · C nexpdf_signature_timestamp_request

AddSignatureTimestamp

func AddSignatureTimestamp(data []byte, token []byte) ([]byte, error)

B-T in Schritten: speichert die Antwort der TSA (TimeStampResp oder TimeStampToken) in der letzten Signatur, signierte Bytes unverändert, und liefert das PDF.

Auf package nexpdf · Modul signatures · C nexpdf_add_signature_timestamp

LTVRequestsJSON

func LTVRequestsJSON(data []byte, responsesJson string) (string, error)

B-LT in Schritten: die HTTP-Anfragen (OCSP, CRL, Zertifikate), die die Validierungsdaten noch benötigen, gegeben die bisherigen Antworten; [], wenn nichts fehlt.

Auf package nexpdf · Modul signatures · C nexpdf_ltv_requests_json

AddLTVWithResponses

func AddLTVWithResponses(data []byte, responsesJson string) ([]byte, error)

B-LT in Schritten: fügt das /DSS aus den abgerufenen Antworten hinzu (fehlende zählen als fehlgeschlagen), als inkrementelle Aktualisierung, und liefert das PDF.

Auf package nexpdf · Modul signatures · C nexpdf_add_ltv_with_responses

ValidateLtaJSON

func ValidateLtaJSON(data []byte, trustRootsPem string) (string, error)

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 package nexpdf · Modul signatures · C nexpdf_validate_lta_json

PDF/A, PDF/X und PDF/UA

ConvertPDFA

func (d *Document) ConvertPDFA() (int32, error)

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

Auf Document · Modul standards · C nexpdf_convert_pdfa

ConvertPDFX

func (d *Document) ConvertPDFX() (int32, error)

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

Auf Document · Modul standards · C nexpdf_convert_pdfx

AutoTag

func (d *Document) AutoTag(lang string, force int32) (string, error)

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 neu. Liefert einen JSON-Bericht.

Auf Document · Modul standards · C nexpdf_auto_tag

ValidatePDFAJSON

func (d *Document) ValidatePDFAJSON(level string) (string, error)

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

Auf Document · Modul standards · C nexpdf_validate_pdfa_json

ValidatePdfuaJSON

func (d *Document) ValidatePdfuaJSON() (string, error)

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

Auf Document · Modul standards · C nexpdf_validate_pdfua_json

ConvertPDFALevel

func (d *Document) ConvertPDFALevel(level string) (int32, error)

Konvertiert in eine gewählte PDF/A-Stufe (2b, wenn leer); bei Stufe A wird das Dokument zuerst getaggt. 1, wenn das Ergebnis validiert; andernfalls listet der Fehler die weiterhin fehlschlagenden Klauseln auf.

Auf Document · Modul standards · C nexpdf_convert_pdfa_level

ConvertPDFAJSON

func (d *Document) ConvertPDFAJSON(level string, flattenDpi float64, substituteFonts int32) (string, error)

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 unverändert.

Auf Document · Modul standards · C nexpdf_convert_pdfa_json

ConvertPdfuaJSON

func (d *Document) ConvertPdfuaJSON(part int32, lang string) (string, error)

Konvertiert nach 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-Namensräume. 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

ValidatePdfuaPartJSON

func (d *Document) ValidatePdfuaPartJSON(part int32) (string, error)

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

Auf Document · Modul standards · C nexpdf_validate_pdfua_part_json

RegisterSubstituteFont

func RegisterSubstituteFont(data []byte) (string, error)

Registriert TrueType-Schriftdaten für die Schriftersetzung 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-Umrissen sind.

Auf package nexpdf · Modul standards · C nexpdf_register_substitute_font

OCR

OCR

func (d *Document) OCR(optionsJson string) (string, error)

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

OCRLoadModel

func OCRLoadModel(optionsJson string, model []byte, dictionary string) (int32, error)

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 Textrichtungs-Klassifikator (0°/180°) benötigt keines.

Auf package nexpdf · Modul ocr · C nexpdf_ocr_load_model

OCRModelsJSON

func OCRModelsJSON() (string, error)

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

Auf package nexpdf · Modul ocr · C nexpdf_ocr_models_json

OCRUnloadModels

func OCRUnloadModels(languages string) (int32, error)

Entlädt die OCR-Modelle der angegebenen Sprachen (alle, wenn leer). Liefert die Anzahl der entfernten.

Auf package nexpdf · Modul ocr · C nexpdf_ocr_unload_models

Vergleichen, optimieren und Speicher

CompareJSON

func (d *Document) CompareJSON(b *Document, dpi float64) (string, error)

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

Auf Document · immer verfügbar · C nexpdf_compare_json

CompareOverlayPNG

func (d *Document) CompareOverlayPNG(b *Document, pageIndex int, dpi float64) ([]byte, error)

Eine PNG-Überlagerung der visuellen Unterschiede einer Seite zweier Dokumente.

Auf Document · immer verfügbar · C nexpdf_compare_overlay_png

Optimize

func (d *Document) Optimize() (string, error)

Optimiert das Dokument (entfernt nicht verwendete Objekte, komprimiert Streams neu); liefert einen JSON-Bericht.

Auf Document · Modul editor · C nexpdf_optimize

SubsetFonts

func (d *Document) SubsetFonts() (string, error)

Erzeugt Teilmengen der eingebetteten Schriften mit den vom Dokument verwendeten Glyphen; liefert einen JSON-Bericht.

Auf Document · Modul editor · C nexpdf_subset_fonts

TrimMemory

func (d *Document) TrimMemory() int

Verwirft zwischengespeicherte Daten des Dokuments; liefert die freigegebenen Bytes.

Auf Document · immer verfügbar · C nexpdf_trim_memory

MemoryUsageBytes

func (d *Document) MemoryUsageBytes() int

Ungefährer vom Dokument belegter Speicher in Bytes.

Auf Document · immer verfügbar · C nexpdf_memory_usage_bytes

CompareTextJSON

func (d *Document) CompareTextJSON(b *Document, optionsJson string) (string, error)

Textvergleich auf Wortebene zweier Dokumente: eingefügter, gelöschter, ersetzter und verschobener Text mit Positionen sowie eine Zusammenfassung. Optionen {"ignore_case","ignore_punctuation","detect_moves","min_move_words","align","page_map"}.

Auf Document · immer verfügbar · C nexpdf_compare_text_json

CompareAnnotate

func (d *Document) CompareAnnotate(b *Document, optionsJson string) ([]byte, error)

Der Vergleich auf Wortebene als neues PDF mit Hervorhebungs-Annotationen (gelöscht rot, eingefügt grün, verschoben blau). Die Optionen ergänzen output, author und die Farben.

Auf Document · immer verfügbar · C nexpdf_compare_annotate

Weitere

SetAnnotationFlags

func (d *Document) SetAnnotationFlags(num uint32, generation uint16, flagsJson string) (int32, error)

Annotationsflags (/F). flags_json: {"readonly":true,"print":false} ändert nur die genannten Flags; ["print","locked"] setzt genau diese; eine Zahl ist die Bitmaske. Namen: invisible, hidden, print, nozoom, norotate, noview, readonly, locked, togglenoview, lockedcontents. XFDF-Import und -Export behalten sie bei (flags="print,readonly"). 1 bei Erfolg.

Auf Document

SetAnnotationStyle

func (d *Document) SetAnnotationStyle(num uint32, generation uint16, styleJson string) (int32, error)

Farbe, Deckkraft und Rahmenbreite, danach eine neue Darstellung: {"color":"#RRGGBB","opacity":0.5, "border_width":2}, jeder Schlüssel optional (ein fehlender Schlüssel behält den aktuellen Wert). 1 bei Erfolg.

Auf Document

Auf dieser Seite

Einrichtung und LebenszyklusErrorVersionActivateLicenseIsLicensedOpenBytesOpenCloseSaveCopyBibliothek und LizenzierungLicenseStatusJSONInvokeRegisterStandardFontHasBundledFontsÖffnen und SpeichernOpenBytesWithPasswordFromHTMLOpenOfficeOpenEbookOpenImageSaveBytesSaveLinearizedSeiten und RenderingPageCountPageWidthPageHeightPageViewJSONRenderPagePNGRenderThumbPNGSetOverprintText, Suche und AssistentExtractPageTextExtractMarkdownSearchJSONPageBlocksJSONAskDocumentPageWordsJSONKonvertierungToHTMLToJSONToXMLToCSVToRTFToDOCXToXLSXToPPTXToReflowHTMLOpenXLSXWithClockOpenDOCXWithOptionsJSONVorlagenTemplateDOCXToPdfTemplateDOCXFillTemplateHTMLToPdfTemplateFillPdfTemplateDOCXFillWithOffice-BearbeitungXLSXEditXLSXCellsJSONDOCXEditDOCXParagraphsJSONStrukturierte Extraktion und BarcodesExtractTablesJSONExtractKeyValuesJSONExtractionPromptJSONExtractionValidateJSONClassifyDocumentJSONReadBarcodesJSONReadBarcodesImageJSONAddBarcodeAddBarcodeExAnnotationenAddAnnotationAddInkAddLineAnnotationsJSONRemoveAnnotationMoveAnnotationSetAnnotationContentsExportXFDFImportXFDFFlattenAnnotationsAddImageStampAddMeasurementMeasurementsJSONAddFileAttachmentAnnotAddInkSignatureReplyToAnnotationAnnotationRepliesJSONSetAnnotationStateFormulareFormFieldsJSONFillFormFieldSetSignatureAppearanceAddFormFieldFlattenFormsRecalculateFormsExportFormJSONImportFormJSONExportFormFDFImportFormFDFExportFormXFDFImportFormXFDFXFA-FormulareXfaInfoJSONXfaExportDataXfaImportDataXfaToAcroformXfaFlattenXfaRemoveXfaToAcroformJSONXfaRunScriptsJSONRegisterFallbackFontZusammenarbeit in EchtzeitSyncExportJSONSyncExportLocalJSONSyncApplyJSONSyncSnapshotJSONSyncSetClientIdSeitenbearbeitungRotatePageDeletePageDuplicatePageAddBlankPageReversePagesMovePageCropPageExtractPagesAppendDocumentInsertImagePagesSetPageBackgroundRemovePageBackgroundInhaltsbearbeitungPageContentJSONEditTextAddPageTextDeleteContentTransformImageReplaceImageEditTextBlockMetadaten, Lesezeichen, Ebenen und AnhängeMetadataJSONSetMetadataOutlinesJSONSetOutlinesJSONPageLabelsJSONSetPageLabelsJSONLayersJSONSetLayerVisibleAttachmentsJSONAttachmentDataAddAttachmentRemoveAttachmentVerschlüsselung, Wasserzeichen und StempelEncryptAES256EncryptWithPermissionsSecurityJSONRemovePasswordAddWatermarkRemoveWatermarksAddHeaderFooterAddBatesSchwärzungApplyRedactionRedactMatchesDigitale SignaturenSignPAdESSignPKCS12PKCS12InfoJSONPrepareExternalSignatureExternalSignatureDataCompleteExternalSignatureVerifySignaturesJSONVerifySignaturesWithRootsJSONAddLTVAddDocumentTimestampAddDocumentTimestampBytesPrepareDocumentTimestampDocumentTimestampRequestCompleteDocumentTimestampSignatureTimestampRequestAddSignatureTimestampLTVRequestsJSONAddLTVWithResponsesValidateLtaJSONPDF/A, PDF/X und PDF/UAConvertPDFAConvertPDFXAutoTagValidatePDFAJSONValidatePdfuaJSONConvertPDFALevelConvertPDFAJSONConvertPdfuaJSONValidatePdfuaPartJSONRegisterSubstituteFontOCROCROCRLoadModelOCRModelsJSONOCRUnloadModelsVergleichen, optimieren und SpeicherCompareJSONCompareOverlayPNGOptimizeSubsetFontsTrimMemoryMemoryUsageBytesCompareTextJSONCompareAnnotateWeitereSetAnnotationFlagsSetAnnotationStyle