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

1 次查看(过去 30 天)
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;

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by