Hmm interesting... I just went through this user experience on iOS generating PDF invoices locally. I attempted the HTML > PDF route, but Webkit is thorny wrt to layouts (as you mentioned). I did settle in with drawing everything from the ground up > which with LLMs wasn't as hairy as it used to be, even got a little Swift framework out of the deal.
Am I understanding the docs correctly that you don't have a local library available (the SDKs are just calling the APIs right?)? Mind going through why you chose a remote API?