Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to reading PDF file with QTextEdit
Renn last edited by Renn
Hello friends, I want to ask you, I want to read the text contained in the PDF file. How do I do that? Previously I've tried using QByteArray, it can not. This code uses QByteArray:
QString getFile = "/home/rnd/Instalasi.pdf";
QByteArray pdfFile = file.readAll();
qDebug() << pdfFile;
2 0 obj
<</Length 3 0 R/Filter/FlateDecode>>
PDFs are binary structured files, so you'll have to parse the contents to extract the text. Wikipedia provides an overview of the file structure for different versions. There might be some packages (libraries) that could be used to read PDF contents, and my advice is to research which one of them might (possibly) be of use to you.
There's an interesting Wiki article here about PDF handling.