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 10-27-2009, 03:18 PM   #38 (permalink)
pmattf
Registered Member
 
Join Date: Feb 2009
Location: Seattle
Posts: 48
pmattf is on a distinguished road
Default Generate a pdf file from current contents of UIWebView

Does anybody know how to take the current contents of a UIWebView and save them into a pdf file?

Using this tutorial as a starting point, I took out everything between CGContextBeginPage and CGContextEndPage.

I first tried
Code:
// webView is my passed in UIWebView *
[webView.layer drawInContext:pdfContext];
The documentation says that UIView's have a layer property of type CALayer *, and CALayer has a drawInContext method. Yet I get a warning that there is no drawInContext method here, and nothing happens when I run it.

Next I tried:
Code:
UIGraphicsPushContext(pdfContext);
[webView setNeedsDisplay];
UIGraphicsPopContext();
Which I think may be closer to the right track, but that still generates an empty pdf file.

Any help would be appreciated.
pmattf is offline   Reply With Quote
 

» Advertisements
» Online Users: 529
15 members and 514 guests
.Snipe, Bertrand21, brajpal, daunmi, dhun, fugufish, GraffitiCircus, HemiMG, HowEver, ilmman, jasonqg49, Libera, Newbie123, tommiss12
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,318
Threads: 93,987
Posts: 402,404
Top Poster: BrianSlick (7,978)
Welcome to our newest member, Libera
Powered by vBadvanced CMPS v3.1.0

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