sinduja_venkata
11 years agoOccasional Contributor
Unable to read pdf : “dotNET.org_apache_pdfbox_pdmodel.PDDocument” is null or not an object
Hi,
I am trying to read the pdf file using pdfbox dll. I have gone through the threads and have followed the steps mentioned in the following thread:
Steps performed:
• Downloaded the complete and latest version of PDFBox .NET from here:
http://www.squarepdf.net/pdfbox-in-net and unzipped the archive.
• Add the pdfbox-1.8.4.dll file to CLR Bridge.
Sample pdf:
Script used: [JScript]
function Test()
{
var strFileName = "C:\\Work2\\TestComplete-datasheet.pdf";
var doc = dotNET.org_apache_pdfbox_pdmodel.PDDocument.load(strFileName);
var pdfStripper = dotNET.org_apache_pdfbox_util.PDFTextStripper.zctor_2();
var str = pdfStripper.getText_2(doc);
Log.Message("See Additional Info", str);
}
While executing this script, I get this error message: “dotNET.org_apache_pdfbox_pdmodel.PDDocument” is null or not an object.
Please find the attachements for the same.
Can you please let me know as how to overcome this error message?
Thanks.
Update from the Support team: The problem was caused by Windows blocking the files downloaded from the Internet. It was resolved by clicking Unblock in the properties of each of the PDFBox DLLs.