UIWebView with PDF

I am showing a PDF file using UIWebView, and I want to do 2 things:

  • I want the page to fit the phone screen, and the user does not have to double-click to do this

  • I want to remove the gray shadow margin around the displayed PDF

thanks for the help

+3
source share
5 answers

I don’t think this will help much, but I think your best option is to make a PDF for the image (worthy of DPI) and display the image instead. I do this for the application, but we do this server part using ImageMagick - you don’t know how to do it in obj-c. Also note that basically text-based PDF will be much larger (file size) when rasterized.

However, you can also try to insert the PDF file into the HTML page and load this HTML code into the WebView, which can at least avoid the gray border / artboard.

+1
source
webView.transform = CGAffineTransformScale( webView.transform, 1.25, 1.25 );
+1
source

2 - " " IB

1. , , PDF , , , ?

+1

Where has the CGAFFineTransformScale been for life?

Seriously, this is a big help. However, it worked better with webView.scrollView.

Finally, is there a similar command to change the content offset as well as the scale?

-1
source

Source: https://habr.com/ru/post/1717063/


All Articles