PDF does not support webp, and Flying Saucer, the PDF renderer for Salesforce (and other programs), does not support webp; it would need to translate the webp file into a JPEG file to be usable in PDF. As a consequence, these images can't be displayed inside the PDF. You'll need to use a supported format. The reason why the page shows the image in the ...
It’s many months later, but just seeing this. I had a similar requirements and chose to implement a microservice on Heroku to scrape the text from a PDF. It’s called from Apex which does the final parsing of the returned text. I’ve presented on the topic if you’re interested here:
The service is tiny, less than 100 lines of code ...
As per my understanding this is not directly available in Salesforce. But if you can do alternative ways -
Use JS with pdf2 JSON and get the count - https://stackoverflow.com/a/30132117
Added code here for direct reference from above link -
var PDFParser = require('pdf2json');
var pdfParser = new PDFParser();