Ability to print remote content via URI
This commit is contained in:
parent
6053b1f83a
commit
7cae0fa4a5
@ -155,13 +155,20 @@
|
|||||||
|
|
||||||
[self adjustWebView:page andPrintPageRenderer:renderer];
|
[self adjustWebView:page andPrintPageRenderer:renderer];
|
||||||
|
|
||||||
// Set the base URL to be the www directory.
|
if ([NSURL URLWithString:content]) {
|
||||||
NSString* wwwFilePath = [[NSBundle mainBundle] pathForResource:@"www"
|
NSURL *url = [NSURL URLWithString:content];
|
||||||
ofType:nil];
|
|
||||||
NSURL* baseURL = [NSURL fileURLWithPath:wwwFilePath];
|
[page loadRequest:[NSURLRequest requestWithURL:url]];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Set the base URL to be the www directory.
|
||||||
|
NSString* wwwFilePath = [[NSBundle mainBundle] pathForResource:@"www"
|
||||||
|
ofType:nil];
|
||||||
|
NSURL* baseURL = [NSURL fileURLWithPath:wwwFilePath];
|
||||||
|
|
||||||
|
|
||||||
[page loadHTMLString:content baseURL:baseURL];
|
[page loadHTMLString:content baseURL:baseURL];
|
||||||
|
}
|
||||||
|
|
||||||
controller.printPageRenderer = renderer;
|
controller.printPageRenderer = renderer;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user