Hello!

I already know how to read a text from a .txt file using QFile, QTextStream and so forth, but I don't know how to open a .pdf file and read its content. I tried to do it in the same way recently, and what I got was:

Qt Code:
  1. "%PDF-1.5
  2. %µµµµ
  3. 1 0 obj
  4. <</Type/Catalog/Pages 2 0 R/Lang(pt-BR) /StructTreeRoot 8 0 R/MarkInfo<</Marked true>>>>
  5. endobj
  6. 2 0 obj
  7. <</Type/Pages/Count 1/Kids[ 3 0 R] >>
  8. endobj
  9. 3 0 obj
  10. <</Type/Page/Parent 2 0 R/Resources<</Font<</F1 5 0 R>>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/MediaBox[ 0 0 595.2 841.92] /Contents 4 0 R/Group<</Type/Group/S/Transparency/CS/DeviceRGB>>/Tabs/S/StructParents 0>>
  11. endobj
  12. 4 0 obj
  13. <</Filter/FlateDecode/Length 147>>
  14. stream
  15. xœM±
  16. Â0„÷@ÞáÆ?C“üiÓ8”M«(²AÁÇ7YTnø8îƒÙ£ëÌ·#lßc#†$…Y3˜µmÎR0lN&¶Õu@^7é&…Å¥ÔFŠ…’ªxE'U3½Ÿªj讜#djé˜ÛÑ£€×Uq *H;)¦,+¯·ÚûÅ’/~[LsÄì_#ó
  17. endstream
  18. endobj
  19. 5 0 obj
  20. <</Type/Font/Subtype/TrueType/Name/F1/BaseFont/Times#20New#20Roman/Encoding/WinAnsiEncoding/FontDescriptor 6 0 R/FirstChar 32/LastChar 120/Widths 14 0 R>>
  21. endobj
  22. 6 0 obj
  23. <</Type/FontDescriptor/FontName/Times#20New#20Roman/Flags 32/ItalicAngle 0/Ascent 891/Descent -216/CapHeight 693/AvgWidth 401/MaxWidth 2568/FontWeight 400/XHeight 250/Leading 42/StemV 40/FontBBox[ -568 -216 2000 693] >>
  24. endobj
  25. 7 0 obj
  26. <</Author(Martin)/Creator(þÿ
To copy to clipboard, switch view to plain text mode 

while the text inside was "texto aqui".

So how do I open a .pdf file and read its content inside a Qt software?

Thanks!

Momergil