Right now I am able to generate a PDF using the code below. The issue is that the generated PDF is not searchable nor its texts copyable. (like the whole PDF is a image).
Is there a way to create a PDF using ios (Swift) that has its texts copyable/searchable?
Part of my code that generates the pdf:
let pdfFrame:CGRect = CGRect(x: 0, y: 0, width: sourceView.contentSize.width, height: sourceView.contentSize.height);
UIGraphicsBeginPDFContextToFile(dataFilename, pdfFrame, nil);
UIGraphicsBeginPDFPageWithInfo(pdfFrame, nil);
sourceView.contentOffset = CGPoint.zero;
sourceView.frame = pdfFrame;
let pdfContext : CGContext = UIGraphicsGetCurrentContext()!;
sourceView.layer.render(in: pdfContext);
UIGraphicsEndPDFContext();