我想用iText 解析这个文件(http://www.bbm.ca/_documents/top_30_tv_programs_english/2011/nat01032011.pdf).问题是它没有被标记,所以我无法获取XML文件.我决定从中提取文本,我认为例如第一行将是:
1\specialCharWJC:PLAYOFFS CANADA\specialCharTSN+\specialCharM.W....\specialChar19:30\specialChar21:57\specialChar5133
我为第一行提取的文字是
1 WJC:PLAYOFFS CANADA TSN+ M.W.... 19:30 21:57 5133
我使用以下方法提取文本:
PdfReader reader = new PdfReader(filename); String str = PdfTextExtractor.getTextFromPage(reader, 1);
PDf观众如何知道加拿大在第二列不在第三列.
我目前的解决方案是使用http://www.idrsolutions.com/online-pdf-to-html5-converter/将pdf文件转换为html5 ,后者可以确定每列的文本.
感谢您的答复