-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Hello,
I suddenly changed from an old version of NDHTMLtoPDF with UIWebView to the current version with WKWebView. Then problem now is, that I'm missing the images in the pdf. Is this a bug or do I need to change something in the code?
Code for the image (the logo)
NSString *fileURLString = [[[NSBundle mainBundle] URLForResource:@"Logo" withExtension:@"png"] absoluteString];
[htmlStrForPDF appendString:[NSString stringWithFormat:@"<td style=\"border-style:hidden\"; align=\"right\"><img src=\"%@\"/ alt=\"Logo\"; style=\"width:74px; height:50px\"></td>", fileURLString]];
[htmlStrForPDF appendString:@"</tr></table>"];Code for creating the pdf
PlanExport *export = [[PlanExport alloc] init];
NSMutableString *htmlStrForPDF = [export createPDFPlan];
CGSize paperSize = CGSizeMake(839, 595); // DIN A4
NSString *ns_pathForFile = [NSString stringWithFormat:@"%@.%@",LocalizedString(@"PlanFileName", nil), LocalizedString(@"ExportFormatPDF", nil)];
self.PDFCreator = [NDHTMLtoPDF createPDFWithHTML:htmlStrForPDF pathForPDF:[AppCommon GetPathForFile:ns_pathForFile] pageSize:paperSize margins:UIEdgeInsetsMake(10, 15, 20, 15) successBlock:^(NDHTMLtoPDF *htmlToPDF) {
NSString *result = [NSString stringWithFormat:@"HTMLtoPDF did succeed (%@ / %@)", htmlToPDF, htmlToPDF.PDFpath];
NSLog(@"%@",result);
// Send the generated file through Email.
[self showEmail];
} errorBlock:^(NDHTMLtoPDF *htmlToPDF) {
NSString *result = [NSString stringWithFormat:@"HTMLtoPDF did fail (%@)", htmlToPDF];
NSLog(@"%@",result);
}];Metadata
Metadata
Assignees
Labels
No labels