4
In my program I need to open a PDF file and pick up the text that contains it. But when opening the PDF, the text comes badly formatted. For example:
Please to `my fam ? read by ? measure efforts
When the right thing would be:
I thank my family for not measuring efforts
This only occurs when the PDF is generated by latex. When it is generated by word, the text is normal.
The code I’m using to open the pdf is:
int i = 1;//Sendo n o numero de paginas
PdfReader reader = new PdfReader(diretorio);
while(i<=n){
conteudo+=PdfTextExtractor.getTextFromPage(reader, i);
i++;
}
I know it has to do with encoding, but I don’t know how to solve/ what to do!
Remembering that Pdfs will not be generated by me.
If you copy and paste the character, with the same mouse, how does it look? You could paste it here for us to see?
– Math
@Math actually the example I quoted, has already been copied and pasted.
– Pacíficão