1

Why can't I find reader.getPageN(1)? It could not be found from PdfReader.java also. How can I fix this?

itext replace

Toto
  • 89,455
  • 62
  • 89
  • 125
  • 1
    You are trying to use iText5 code with iText7 library. Either downgrade your dependency to iText 5.5.13.1 (deprecated version) or adapt your code for iText7. – André Lemos Dec 10 '19 at 07:36

1 Answers1

1

It appears you are trying to use iText5 code, while using iText7 as a dependency (the API has changed between these two versions).

The good news is that iText has an example for iText7 with what you are trying to achieve on their examples repository.

André Lemos
  • 837
  • 6
  • 18
  • When I tried to replace a text as the example, and nothing happened except generating that file with a new name... – Ngô Văn Quyền Dec 11 '19 at 01:04
  • here the one: https://jobsgo.vn/uploads/cv/web/2f1470d5b83f1ed908a158406a599a837187097e-1566886719.pdf – Ngô Văn Quyền Dec 12 '19 at 02:14
  • putting it in super simple terms, the text isn't present in the PDF in a way that that code sample will work (it's constructed with a lot of information). To be able to do it, you'd have to follow this answer https://stackoverflow.com/a/57398454/1566339 – André Lemos Dec 12 '19 at 08:49