2

Currently i am making "traditional" screenshots and combine them using a graphics editor to show the full webpage at once. Is there any more efficient way of making screenshots of a full webpage, just as by using Awesome Screenshot for Google Chrome?

(No, i do not have an iPhone ;)

Nithin Michael
  • 2,166
  • 11
  • 32
  • 56
Julian Weimer
  • 2,605
  • 4
  • 22
  • 23

2 Answers2

0

You have to write it on your own.

  1. Create a fullscreen webView inside your app.
  2. Open page you want to open
  3. Manipulate the property webView.scrollView to move successfully to the bottom of the page.
  4. Capture screenshot every time
  5. If you're on the bottom merge screenshots to one large images.

I believe this is a simplest way and run on the simulator.

Jakub
  • 13,712
  • 17
  • 82
  • 139
  • I have no experience in developing mobile applications, and i just want to test a website rather than a mobile app. But if your solution works, one could develop an application just for this purpose. – Julian Weimer Dec 16 '13 at 12:40
0

See the code below.

-(NSData *)getImageFromView:(UIView *)view  // Mine is UIWebView but should work for any
{
    NSData *pngImg;
    CGFloat max, scale = 1.0;
    CGSize viewSize = [view bounds].size;
// Get the size of the the FULL Content, not just the bit that is visible
CGSize size = [view sizeThatFits:CGSizeZero];

// Scale down if on iPad to something more reasonable
max = (viewSize.width > viewSize.height) ? viewSize.width : viewSize.height;
if( max > 960 )
    scale = 960/max;

UIGraphicsBeginImageContextWithOptions( size, YES, scale );

// Set the view to the FULL size of the content.
[view setFrame: CGRectMake(0, 0, size.width, size.height)];

CGContextRef context = UIGraphicsGetCurrentContext();
[view.layer renderInContext:context];    
pngImg = UIImagePNGRepresentation( UIGraphicsGetImageFromCurrentImageContext() );

UIGraphicsEndImageContext();
return pngImg;    // Voila an image of the ENTIRE CONTENT, not just visible bit

}

I got this code from this link. Hope it will help you.

Community
  • 1
  • 1
Nithin Michael
  • 2,166
  • 11
  • 32
  • 56