Skip to content

Instantly share code, notes, and snippets.

@EdSancha
Created April 20, 2015 21:05
Show Gist options
  • Save EdSancha/2e58f25b174fa4aa5418 to your computer and use it in GitHub Desktop.
Save EdSancha/2e58f25b174fa4aa5418 to your computer and use it in GitHub Desktop.
Override html format
- (NSString *)overrideHTMLFormat:(NSString *)htmlText {
NSArray *tagsToOverride = @[@"body",@"b", @"a", @"td", @"span", @"p", @"div"];
NSString *header = @"<head><style> ";
for (NSString *tag in tagsToOverride) {
header = [header stringByAppendingString:tag];
header = [header stringByAppendingString:@" {font-family: HelveticaNeue !important; font-size: 11pt !important; line-height:18pt !important} "];
}
header = [header stringByAppendingString:@" </style></head> "];
NSString *htmlString = [NSString stringWithFormat:@"%@ <body>%@</body>", header, htmlText];
return htmlString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment