try { Document document = new Document(); document.open(); PdfReader reader = new PdfReader("FilePath"); PdfDictionary dictionary = reader.getPageN(1); PRIndirectReference reference = (PRIndirectReference) dictionary.get(PdfName.CONTENTS); PRStream stream = (PRStream) PdfReader.getPdfObject(reference); byte[] bytes = PdfReader.getStreamBytes(stream); PRTokeniser tokenizer = new PRTokeniser(bytes); StringBuffer buffer = new StringBuffer(); while (tokenizer.nextToken()) { if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) { buffer.append(tokenizer.getStringValue()+" "); } } String test = buffer.toString(); out.println(test); } catch (Exception e) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)