I have a WebView and want to print it is HTML content via AirPrint. I want to add custom page margins to this content. I was able to achieve it using my own subclass of
Now, when my app user uses the duplex printer (print on the front and back of the page), I will specify different page margins for the front and back pages.
UIPrintPageRenderer was unable to accomplish this task since it requests
footerHeight as a single property and it has nothing like
headerHeight (front page :)
] I've also researched the ability to create PDF, but apparently, PDF files are generated only with UIPrintPageRenderer.
I also don't know how to override or get customized
UIViewPrintFormatter from WKWebView, since this object is returned by WebView's function
func viewPrintFormatter () -> UIViewPrintFormatter