Write PDF

Is there a way to create PDF from an iOS app?
I believe that the underlying Apple APIs make this pretty easy just by giving a different context for drawing (I could be wrong).
I need to draw out a really pleasing PDF for my users to print, and I’d prefer to generate it in the app, but I can do it server-side if needed.

Any suggestions would be appreciated.

That is exactly how it is done… (3 addtional lines in Swift)… but alas… Xojo doesn’t expose that without perhaps resorting to declares (and I’m thinking that won’t work either)

For iOS you could do declares to CoreGraphics functions from Apple.

Sorry, no plugins for iOS:

If generating the PDF from an HTML source is suitable for you, I have an easy solution.
Basically, instead of drawing all elements as you would do in a Canvas, you set up an HTML template and just replace what needs to be set in the HTML.
Then just pass the HTML to the xcHTML2PDF class.

https://www.jeremieleroy.com/wpg/bin/xcHTML2PDF_v002.zip

[quote=471469:@Jeremie Leroy]If generating the PDF from an HTML source is suitable for you I have an easy solution.
Basically, instead of drawing all elements as you would do in a Canvas, you set up an HTML template and just replace what needs to be set in the HTML.
Then just pass the HTML to the xcHTML2PDF class.

https://www.jeremieleroy.com/wpg/bin/xcHTML2PDF_v002.zip[/quote]

try the download and it say missing “app icon”

Fixed!
Thank you Richard

[quote=471471:@Jeremie Leroy]Fixed!
Thank you Richard[/quote]

thanks!!! can open the project now
what xCode can i use to compile this?? i have xCode 11.3

never mind… i use the wrong version of Xojo.

In my case, I do have a server that can create it, and probably should for some other reasons.
However I learned a lot in this thread. Thank you all.