java - PDF parser text contains -


i want verify pdf document using testng , pdfbox.

i ask, pdf able check contains text this:

pdfparser parser =  new pdfparser(stream); parser.getdocument().conntains("abc") 

try below code:-

  public void readpdf() throws exception {     url testurl = new url("http://www.axmag.com/download/pdfurl-guide.pdf");      bufferedinputstream testfile = new bufferedinputstream(testurl.openstream());     pdfparser testpdf = new pdfparser(testfile);     testpdf.parse();     string testtext = new pdftextstripper().gettext(testpdf.getpddocument());      assert.asserttrue(testtext.contains("open setting.xml, can see this"));      } 

download libraries :- https://pdfbox.apache.org/index.html


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -