I have this java code:
try { PDFTextStripper pdfs = new PDFTextStripper(); String textOfPDF = pdfs.getText(PDDocument.load("doc")); doc.add(new Field(campo.getDestino(), textOfPDF, Field.Store.NO, Field.Index.ANALYZED)); } catch (Exception exep) { System.out.println(exep); System.out.println("PDF fail"); }
And throws it away:
11:45:07,017 WARN [COSDocument] Warning: You did not close a PDF Document
And I donβt know why, but throw it 1, 2, 3 or more.
I find that COSDocument is a class and has a close () method, but I don't use this class anywhere.
I have this import:
import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.util.PDFTextStripper;
Thanks:)
java pdf pdfbox
bonsai
source share