Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-31-2011, 01:46 AM   #9 (permalink)
sivaram
iphone developer
 
sivaram's Avatar
 
Join Date: Jun 2010
Location: Chennai
Age: 24
Posts: 32
sivaram is on a distinguished road
Send a message via Skype™ to sivaram
Thumbs up

Quote:
Originally Posted by RUser View Post
Hi Belkin,

Do you got any option to save Webview contents as PDF?
If yes,Kindly help Me
To save the webview contents as an image use the following code.
Code:
	CGSize sixzevid=CGSizeMake(1024,1100);
	UIGraphicsBeginImageContext(sixzevid);
	[webview.layer renderInContext:UIGraphicsGetCurrentContext()];
	UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
	UIGraphicsEndImageContext();
	
	NSData *imageData = UIImagePNGRepresentation(viewImage);
	
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
	NSString *documentsDirectory = [paths objectAtIndex:0];	
	NSString *pathFloder = [[NSString alloc] initWithString:[NSString stringWithFormat:@"%@",@"new.png"]];
	NSString *defaultDBPath = [documentsDirectory stringByAppendingPathComponent:pathFloder];

	
	[imageData writeToFile:defaultDBPath atomically:YES];
After converting it in to an image you can easily convert it as pdf.
sivaram is offline   Reply With Quote
 

» Advertisements
» Online Users: 415
11 members and 404 guests
antonwilliams, Arty Tales, carmeliaxw97, DaveDee, demas, erdinc27, gogoman, Lily.P, MarkC, raymng, roof44
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,594
Threads: 94,083
Posts: 402,778
Top Poster: BrianSlick (7,990)
Welcome to our newest member, kopmlop
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:00 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.