Hi,
We are currently using the PDFDoc newImageJPEG to draw image to a newly created PDF document. The PDF document is successfully created but with blank content, below is our code, is there any step we have left? Thanks
UIImage *img = [UIImage imageWithContentsOfFile:imgPath];
PDFDoc *tmpPDF = [[PDFDoc alloc] init];
[tmpPDF create:tmpPDFPath];
NSString *cacheFile = [[NSTemporaryDirectory() stringByAppendingString:@""] stringByAppendingString:@"cache.dat"];
[tmpPDF setCache:cacheFile];
PDFPage *tmpPDFPage = [tmpPDF newPage:1 :img.size.width :img.size.height];
PDFPageContent *tmpPageContent = [[PDFPageContent alloc] init];
PDFVPage *tmpVPage = [[PDFVPage alloc] init:tmpPDF :0];
[tmpPageContent drawImage:[tmpPDFPage addResImage:[tmpPDF newImageJPEG:imgPath]]];
[tmpPDFPage addContent:tmpPageContent :false];
[tmpVPage DeleteBmp];
[tmpVPage RenderPrepare];
[[tmpVPage Cache] Render];
[tmpPDF save];
Here please find the resultant PDF file and the JPEG image to be added