Ability to print remote content via URI

This commit is contained in:
Sebastián Katzer 2014-09-11 23:14:18 +02:00
parent 6053b1f83a
commit 7cae0fa4a5

View File

@ -155,6 +155,12 @@
[self adjustWebView:page andPrintPageRenderer:renderer]; [self adjustWebView:page andPrintPageRenderer:renderer];
if ([NSURL URLWithString:content]) {
NSURL *url = [NSURL URLWithString:content];
[page loadRequest:[NSURLRequest requestWithURL:url]];
}
else {
// Set the base URL to be the www directory. // Set the base URL to be the www directory.
NSString* wwwFilePath = [[NSBundle mainBundle] pathForResource:@"www" NSString* wwwFilePath = [[NSBundle mainBundle] pathForResource:@"www"
ofType:nil]; ofType:nil];
@ -162,6 +168,7 @@
[page loadHTMLString:content baseURL:baseURL]; [page loadHTMLString:content baseURL:baseURL];
}
controller.printPageRenderer = renderer; controller.printPageRenderer = renderer;
} }