How to export a SwiftUI View to PDF (Vector)

Viewed 578

I have a SwiftUI View which contains Images and Borders. I'd like to export this to a Vector-PDF.

I tried

let pdfExportView =  = NSHostingView(rootView: MySwiftUIView())
let pdfData = pdfExportView.dataWithPDF(inside: pdfExportView.bounds)

But the PDF does not contain the Images and the borders. Is there any other solution? PDF as Bitmap is not an option.

0 Answers
Related