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:
"%PDF-1.5
%µµµµ
1 0 obj
<</Type/Catalog/Pages 2 0 R/Lang(pt-BR) /StructTreeRoot 8 0 R/MarkInfo<</Marked true>>>>
endobj
2 0 obj
<</Type/Pages/Count 1/Kids[ 3 0 R] >>
endobj
3 0 obj
<</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>>
endobj
4 0 obj
<</Filter/FlateDecode/Length 147>>
stream
xœM±
Â0„÷@ÞáÆ?C“üiÓ8â€M«(²AÃÇ7YTnø8îƒÙ£ëÌ·#lßc#†$…Y3˜µmÂÃŽR0lN&¶Õu@^7é&…Å¥ÔFŠ…’ªxE'U3½Ÿªj讜#djé˜ÛÑ£€×Uq *H;)¦,+¯·ÚûÅ’/~[LsÄì_#ó
endstream
endobj
5 0 obj
<</Type/Font/Subtype/TrueType/Name/F1/BaseFont/Times#20New#20Roman/Encoding/WinAnsiEncoding/FontDescriptor 6 0 R/FirstChar 32/LastChar 120/Widths 14 0 R>>
endobj
6 0 obj
<</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] >>
endobj
7 0 obj
<</Author(Martin)/Creator(þÿ
"%PDF-1.5
%µµµµ
1 0 obj
<</Type/Catalog/Pages 2 0 R/Lang(pt-BR) /StructTreeRoot 8 0 R/MarkInfo<</Marked true>>>>
endobj
2 0 obj
<</Type/Pages/Count 1/Kids[ 3 0 R] >>
endobj
3 0 obj
<</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>>
endobj
4 0 obj
<</Filter/FlateDecode/Length 147>>
stream
xœM±
Â0„÷@ÞáÆ?C“üiÓ8â€M«(²AÃÇ7YTnø8îƒÙ£ëÌ·#lßc#†$…Y3˜µmÂÃŽR0lN&¶Õu@^7é&…Å¥ÔFŠ…’ªxE'U3½Ÿªj讜#djé˜ÛÑ£€×Uq *H;)¦,+¯·ÚûÅ’/~[LsÄì_#ó
endstream
endobj
5 0 obj
<</Type/Font/Subtype/TrueType/Name/F1/BaseFont/Times#20New#20Roman/Encoding/WinAnsiEncoding/FontDescriptor 6 0 R/FirstChar 32/LastChar 120/Widths 14 0 R>>
endobj
6 0 obj
<</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] >>
endobj
7 0 obj
<</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
Bookmarks