idoodler
idoodler

Reputation: 3545

Replace text in PDF using Cocoa

I am looking for a way to replace text in an PDF document in my Mac Application. But the problem is that I don't know how. I am thinking of converting the PDF to an HTML file, so I can use stringByReplacingOccurrencesOfString: and then converting it back to an PDF, but I can not find out how.

I also tried to replace the text using CGPDFDocumentRef but I couldn't find a valide method.

Can anyone please help me to solve this issue?

Thanks, David

Upvotes: 0

Views: 114

Answers (1)

iPDFdev
iPDFdev

Reputation: 5834

It is not possible to replace text in PDF using CGPDF* API. PDF -> HTML -> PDF will not work because the double conversion will loose content (PDF and HTML formats are not quite compatible).
The only solution is to find a 3rd party toolkit that supports this functionality.

Upvotes: 1

Related Questions