Programmatically Generate PDF from HTML on iPhone

前端 未结 6 1388
挽巷
挽巷 2021-02-10 15:57

I am looking for a way to programmatically (in obj-c) generate a PDF file from a local html file. I am dynamically generating the html from user inputs, I need to create the PD

6条回答
  •  一向
    一向 (楼主)
    2021-02-10 16:36

    I made it by following this SO: https://stackoverflow.com/a/13342906/448717

    In order to maintain the same content's proportions I had to multiply the size of the WKWebView 1.25 times the printableRect's size set for the UIPrinterRenderer, as the screen points differs from the PostScript's... I guess.

提交回复
热议问题