Re: How to get image of a WebView???
Re: How to get image of a WebView???
- Subject: Re: How to get image of a WebView???
- From: Guy English <email@hidden>
- Date: Wed, 16 Feb 2005 10:56:58 -0500
I haven't tried this myself and haven't played with WebKit much so
I'm not really sure how all the views stick together. That said ...
here:
> initWithFocusedViewRect:[[[[[vc webView] mainFrame]
> frameView] documentView] frame]];
instead of using frame try using bounds.
> initWithFocusedViewRect:[[[[[vc webView] mainFrame]
> frameView] documentView] bounds]];
bounds will return the rectangle that the content fills - ie the whole page.
Guy
On Wed, 16 Feb 2005 04:50:02 -0800 (PST), mradul mandhanya
<email@hidden> wrote:
> hi all
>
> i am very nw to cocoa programming...and to this grp
> too and i have searched teh archive 4 this but
> couldnot find a result of my prob....
>
> i have a problem while getting the image or a pdf of a
> web view.
>
> i have got the pdf but due to some reason(dont know
> why) it is not showing the exact content of the web
> site (i tried it with both options direct writing to
> pdf or priting to pdf - actually safari itself is not
> saving the exact content of the website to PDF ).
>
> i tried to make the TIFF image of the view with
> following code :
>
> [[[[[vc webView] mainFrame] frameView] documentView]
> lockFocus];
>
> bitmap = [[NSBitmapImageRep alloc]
> initWithFocusedViewRect:[[[[[vc webView] mainFrame]
> frameView] documentView] frame]];
>
> [[[[[vc webView] mainFrame] frameView] documentView]
> unlockFocus];
>
> [[bitmap TIFFRepresentation]
> writeToFile:@"webViewImage.TIFF" atomically:YES];
>
> where vc is my outlet to webView... & right now just
> testing to save the image to the disk with name
> webViewImage.TIFF .
>
> but the problem with this method is that it is giving
> me the image of visible protion of the webView only
> :-((
>
> Can anyone plzzz suggest me a better way to get image
> from a WebView or any view ... which also
> includes the portion which is not visible at present.
>
> Thanks a lot!!!!
>
> Pintoo
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - now with 250MB free storage. Learn more.
> http://info.mail.yahoo.com/mail_250
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden