Ability to print remote content via URI
This commit is contained in:
parent
6053b1f83a
commit
7cae0fa4a5
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user