Is it possible to generate nice PDF with gradient from SwiftUI view ?

I try to generate PDF from view. View is nice, there is a lot of transparency and many gradients (circular and linear). But if I use ImageRenderer in in a way that documentation suggest all transparency and gradients disappear. Is this bug or some feature? Is it way to generate vector graphic from view with transparency and gradients? PDF allows those features, so why not?

Answered by DTS Engineer in 813083022

Is it way to generate vector graphic from view with transparency and gradients? PDF allows those features, so why not?

This is not currently supported. I could suggest you please file an enhancement request via Feedback Assistant and post the Feedback ID number here for the record.

You can also use ImageRenderer to generate a CGImage/UIImage/NSImage that you export to a PNG instead.

Accepted Answer

Is it way to generate vector graphic from view with transparency and gradients? PDF allows those features, so why not?

This is not currently supported. I could suggest you please file an enhancement request via Feedback Assistant and post the Feedback ID number here for the record.

You can also use ImageRenderer to generate a CGImage/UIImage/NSImage that you export to a PNG instead.

I hope this is an ID: FB15716546

Is it possible to generate nice PDF with gradient from SwiftUI view ?
 
 
Q