Effacer les filtres
Effacer les filtres

how to overcome this?i am able to read some of my pdf using below code, but still some are unreadable?

1 vue (au cours des 30 derniers jours)
clear java
javaaddpath('C:\Users\Hp-Pc\Documents\MATLAB\PDFBox-0.7.3\lib\PDFBox-0.7.3.jar')
pdfdoc = org.pdfbox.pdmodel.PDDocument;
reader = org.pdfbox.util.PDFTextStripper;
pdfdoc = pdfdoc.load('C:\Users\Hp-Pc\Documents\MATLAB\chemical.pdf');
pdfdoc.isEncrypted
%%text, with planty of padding
pdfstr = reader.getText(pdfdoc) %#ok
class(pdfstr)
pdfstr = char(pdfstr) %#ok
class(pdfstr)
%%text 'unpadded'
pdfstr = deblank(pdfstr) %#ok
%%will get an error here..
pdfdoc = pdfdoc.load('C:\Users\Hp-Pc\Documents\MATLAB\chemical.pdf');
pdfdoc.isEncrypted
pdfstr = reader.getText(pdfdoc) %#ok
%%but press forward..
pdfdoc.getDocument().close;

Réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by