Close popover
Anoop Krishna (AnoopK12)
Hexaware Technologies

Hexaware Technologies
AnoopK12 Member since 2017 2 posts
Hexaware Technologies
Posted: May 17, 2020
Last activity: May 17, 2020

*The constructor PDFParser(PRInputStream) is undefined* error thrown in pega 8.3

I am trying to read pdf file using PDFBox. I got the code which was used in 7.3, I am using that in 8.3. I modified the code and almost was able to clear all the errors except one(PDFParser constructor is throwing error). I have attached the screenshot of the error. Please advice me on the same.


org.apache.pdfbox.text.PDFTextStripper pdfStripper = null;

org.apache.pdfbox.pdmodel.PDDocument pdDoc=null;

org.apache.pdfbox.cos.COSDocument cosDoc = null;

ParameterPage pp = tools.getParameterPage();


  String filePath = pp.getString("FullFilePathName"); // file = new;

PRFile prfCheck = new PRFile(filePath); // fis=null;

PRInputStream fis = null;

org.apache.pdfbox.pdfparser.PDFParser parser = new org.apache.pdfbox.pdfparser.PDFParser(new PRInputStream(prfCheck));

parser.parse(); cosDoc = parser.getDocument();

pdfStripper = new org.apache.pdfbox.text.PDFTextStripper();

pdDoc = new org.apache.pdfbox.pdmodel.PDDocument(cosDoc);

String parsedText = pdfStripper.getText(pdDoc);

tools.putParamValue("ContentSourceAuthored",parsedText); }catch(Exception e) {  throw new PRRuntimeException("Unable to read file '"+e); }

Pega Customer Service 8.3