How to Programmatically fill PDF form field using SwiftUI and PDFKit?

143 views Asked by At

I'm trying to make a program that assigns the value of a variable to a PDF field. For example, a variable "name" fills the name field in my PDF and at the end of everything download the file. I tried using PDFKit and PSPDFKit but I'm not succeeding. Someone to help me?

let document = ILPDFDocument(resource:"ExamplePDFfrom")

document.forms.setValue("David", forFormWithName: "FirstName")

0

There are 0 answers