Reference · Documents and pages · lib.rs

text_to_pdf Function

Text in PDF: laid out by the engine with its own font, the same on every platform. footer: "Seite {n} von {N}".

func textToPdf(input: Data, kind: TextKind, width: Double, height: Double, margin: Double, header: String?, footer: String?) throws -> Data

Parameters

NameTypeSwift / C#
inputVec<u8>input
kindTextKindkind
widthf64width
heightf64height
marginf64margin
headerOption<String>header
footerOption<String>footer

Returns

Vec<u8>

Errors

Throws PagewerkError:

  • Unreadable: “unreadable: {message}”
  • Refused: “refused: {message}”
  • WrongPassword: “wrong password”

Signatures are generated from the engine’s code. Swift is checked against the generated bindings; C# follows the bindings generator’s naming rules.