How to make pdf to fit to screen size in vfr reader - iphone

i am using this vfr reader to show pdf pages.i need to make the pdf page to fit to the entire screen. how can i do this. I tried everything but couldn’t get it. Can someone please lead me to in right direction.
Thanks in advance.

I found a way: Set the statusbar to hidden in viewWillAppear of ReaderViewController, then set READER_SHOW_SHADOWS to FALSE and CONTENT_INSET to 0 in ReaderContentView. Also, make sure your PDF's aspect ratio is 4:3.

In initWithURL:page:password method of ReaderContentPage.m, you need to set viewRect.size to full screen size.

Related

Help required to attain the actual image size

Saving images to a given location
i followed the above link and it works but i dont get actual image size...it is much bigger...
how can i fix it...
Thanks for any help
How do you mean - bigger?
The screen is 320x480 pixels. So if you the view you're saving is the whole screen, that's what you'll get.
Depending on your (computer) screen resolution, this may look quite big or quite small, and will almost certainly look different than the actual size of the iphone screen.

How to fit PDF height in UIWebView in iPhone/iPad

I have a project that uses a UIWebView to display a single page PDF file. I would like this content to fit by height (vertically). The default is only to fit width (horizontally). Is there any way to overcome this?
I ran against the same problem and couldn't find a way to do it with UIWebView. If you only want to display a single PDF-page, you can pretty much take the code from Apple's ZoomingPDFViewer Example.
I took the two classes PDFScrollView and TiledPDFView and with a little adjustment for my project, I was easily able to use it to display a single PDF page.

SVG file render image in smaller size

I am working for the first time with SVG files. I an able to load SVG files on webview but the images are rendering smaller than the original.
they are getting shrinked by a particular factor...... Is there some solution to my problem??? pls help.
Thank You
Meet bhatha
Have you set the UIWebView to Scale To Fit?
Pretty old question, but it is solved applying some javascript magic. Please read this post: UIWebView with just an image that should fit the whole view

UIWebView With PDF

I'm displaying a PDF file using UIWebView, and I want to do 2 things:
I want to make the page fit the phone screen without the user has to double tap to do that
I want to remove the margin with gray shadow around the displayed PDF
Thanks for helping
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.
webView.transform = CGAffineTransformScale( webView.transform, 1.25, 1.25 );
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?
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
Where has CGAFFineTransformScale been all my life?
Seriously, that is a big help. However, it worked better applying it to webView.scrollView.
Finally, is there a similar command to change the offset of the content as well as the scale?

UIWebView frame resize does not resize the inner content

if I change the frame of a UIWebView (scalesPageToFit property is YES), what do I have to do that the zooming level of a currently displayed webpage persists?
Let's say I have a UIWebView frame with a width of 200 pixels, and has zoomed into a website so that only one column is visible. After changing the width to 300, I still see the column with the same size, and additional space at the left and right. But what I would need is that I still only see this column, but bigger.
Any ideas what I have to do to achive this? I tried a lot of things, but nothing worked so far.
By the way, the iPhone built in Safari browser does exactly this thing (with the same website, so it's not content related) when rotating the iPhone... I see the same content, bug bigger, NOT more content as it happens with my current version of code.
Thanks for helping!
Markus
EDIT: Better answer:
mjdth is correct, you can use the contentMode property on the UIWebView. Very simple:
webView.contentMode = UIViewContentModeRedraw;
Old, crap answer:
This worked for me, but I was working with local pages and small amounts of content:
-(void)layoutSubviews
{
// Cause web view to reload content in order to display at new frame size
[webView reload];
}
I'd love to see a better solution that doesn't involve reloading the page though!
What do you have set for the webview's UIViewContentMode (can also be set in IB under the View section's "Mode")? Since you're resizing the view it may have something to do with this. Just a shot in the dark since I haven't tried it but hopefully this helps.
You may also want to try turning off scalesPageToFit before the transition and turning it back on after.