Actually when you open a .PDF page, e.g: http://192.168.1.2/yourFile.pdf, the browser is served as a PDF viewer instead of an actual webpage. Therefore you can’t “spy” or “record” anything on this PDF file due to this fact.

@Keyword
def ReadPDF(String PDFURL)
{
URL TestURL = new URL(PDFURL);
BufferedInputStream bis = new BufferedInputStream(TestURL.openStream());
PDDocument doc = PDDocument.load(bis);
String pdfText = new PDFTextStripper().getText(doc);
doc.close();
bis.close();
println(pdfText);
Assert.assertTrue(pdfText.contains(“Open the setting.xml, you can see it is like this:”));
Assert.assertTrue(pdfText.contains(“Please add the following sentence in setting.xml before”));
Assert.assertTrue(pdfText.contains(“You can see that I have modified the setting.xml, and if open the file in IE, it is like this:”));
println “PDF IS GOOD TO GO…\r”;
}

Hi friend,
I am getting the below error while validating the pdf file. Could you please help me out how to resolve this.
Test Cases/Working_Folder/pdfReader FAILED because (of) org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org/apache/fontbox/FontBoxFont
Thanks,
Abhishek

Hi friend,
I am getting the below error while validating the pdf file. Could you please help me out how to resolve this.
Test Cases/Working_Folder/pdfReader FAILED because (of) org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: org/apache/fontbox/FontBoxFont
Thanks,
Abhishek

@Keyword
def ReadPDF(String PDFURL)
{
URL TestURL = new URL(PDFURL);
BufferedInputStream bis = new BufferedInputStream(TestURL.openStream());
PDDocument doc = PDDocument.load(bis);
String pdfText = new PDFTextStripper().getText(doc);
doc.close();
bis.close();
println(pdfText);
Assert.assertTrue(pdfText.contains(“Open the setting.xml, you can see it is like this:”));
Assert.assertTrue(pdfText.contains(“Please add the following sentence in setting.xml before”));
Assert.assertTrue(pdfText.contains(“You can see that I have modified the setting.xml, and if open the file in IE, it is like this:”));
println “PDF IS GOOD TO GO…\r”;
}

Hi Carlos,
Sorry for the last response… I am not sure why you are seeing that error.
When you use the sample project does that work?
The DNS error may be due to some setup on your side.
Any other Katalon folks have any ideas?