2

I am generating pdf from word document using UIPrintPageRenderer. for this, I am loading doc file in UIwebview and on WebviewdidFinishLoad method, I am generating pdf usingUIPrintPageRenderer. this part is working fine.

Next, I need to detect if generated pdf file is Monochrome or coloured, to decide print price within app.

Problem is,UIWebview is displaying all Hyperlinks in words docs in blue fonts by default and hence generated pdf become coloured. I want to render hyperlinks with Black color as default.

I have tried following but not working:

1) set tint color of UIWebview.

webview.tintColor = [UIColor blackColor];

2) Styling hyper link in uiweview with javascript

 - (void)webViewDidFinishLoad:(UIWebView *)webView
{
    NSString *javaScriptCodeToExecute = @"var link = window.document.getElementById('urlId'); link.style['text-decoration'] = 'none'; link.style.color = 'black';";
    [_webView stringByEvaluatingJavaScriptFromString:javaScriptCodeToExecute];
}
PlusInfosys
  • 3,416
  • 1
  • 19
  • 33
  • 1
    have you checked this http://stackoverflow.com/questions/1350423/can-i-change-the-color-of-auto-detected-links-on-uitextview, http://stackoverflow.com/questions/2205964/how-to-define-link-text-color-in-uiwebview ? – vaibhav Nov 12 '16 at 07:37
  • http://stackoverflow.com/questions/2205964/how-to-define-link-text-color-in-uiwebview -- I have word doc, so this doesn't apply here – PlusInfosys Nov 12 '16 at 09:08
  • @vaibhav http://stackoverflow.com/questions/1350423/can-i-change-the-color-of-auto-detected-links-on-uitextview linkTextAttributes is not property of UIwebview, its for UItextView only. – PlusInfosys Nov 12 '16 at 09:09

0 Answers0