views:

916

answers:

4
+2  Q: 

UIWebView With PDF

Hello Guys,

i'm displaying a PDF file using UIWebView, and i want to do 2 things

  1. I want to make the page fit the phone screen without the user has to double tap to do that

  2. I want to remove the margin with gray shadow around the displayed PDF

Thanks for helping

+1  A: 

I don't think this will help much, but I think your best option is to render the PDF to an image (of decent DPI) and show the image instead. I do this for an app, but we do that server side using ImageMagick - don't know how you might do that in obj-c. Also note that a mostly-text PDF will be much larger (filesize) when rasterized.

However, you might also try to embed the PDF in HTML page and load that HTML in the WebView - that may at least avoid the gray border/artboard.

Jason
+1  A: 
webView.transform = CGAffineTransformScale( webView.transform, 1.25, 1.25 );
Jeff
A: 

You can also use Quartz to do it, as explained here : http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html

Rob
A: 

2 - Checking the Scale Pages to Fit box in IB sorted this for me

I would also like to know the answer to 1. I guess you want to know how to display the PDF in the same way as when opening as attachment in mail, where the navigation bar only appears on a tap and the status bar also disappears?

mizzle