Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

A quick, convenient, and efficient way to download screenshots of websites

License

Notifications You must be signed in to change notification settings

JadenGeller/JGWebScreenshotter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JGWebScreenshotter

JGWebScreenshotter provides a quick, convenient, and efficient way to download screenshots of websites. UIImage representations of websites are requested from the shared instance and returned in a block. The class acts like a queue in that it downloads screenshots in a first-in-first-out order.

Here is an example of a simple request for a 300x300 screenshot of Google's homepage:

[JGWebScreenshotter requestScreenshotWithURL:[NSURL URLWithString:@"http://google.com"] size:CGSizeMake(300,300) completion:^(UIImage *screenshot) {
        // We got the screenshot!
        [self doSomething: screenshot];
}];

You can also request a full-height image of a website by just providing the width:

[JGWebScreenshotter requestScreenshotWithURL:[NSURL URLWithString:@"http://google.com"] width:300 completion:^(UIImage *screenshot) {
        // We got the screenshot!
        [self doSomething: screenshot];
}];

JGWebScreenshotter makes use of a UIWebView+Screenshot class extension that provides methods for taking screenshots (current frame of webview) and full-screenshots (current width, entire page height) of the webview.

UIImage *currentFrame = [myWebView screenshot];
UIImage *entirePage = [myWebView fullScreenshot];

About

A quick, convenient, and efficient way to download screenshots of websites

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published