December 8, 201114 yr Between the various tools how would I get the page count of a PDF iText & ScriptMaster SuperContainer Plugin Scribe
December 9, 201114 yr Author Thanks john renfrew RegisterGroovy( "PDFpage( filePathName ; masterPass )" ; "import com.itextpdf.text.pdf.PdfReader¶ if (masterPass == null) {¶ OWNER = null¶ } else {¶ OWNER = masterPass.getBytes()¶ } //end if¶ try {¶ reader = new PdfReader(filePathName, OWNER)¶ } catch (Exception e) {¶ if (e.toString().contains('BadPassword')) {¶ return 'PASSWORD ERROR'¶ } else {¶ return 'ERROR'¶ }//end if¶ return reader.getNumberOfPages()" )
May 22, 201213 yr Newbies I loaded the iText jar, registered the function, but in text viewer, I'm getting this string: com.itextpdf.text.pdf.PdfReader@17361e2 What am I doing wrong? Thanks!
May 23, 201213 yr Nothing There is a TINY mistake Last three lines should be }//end if }//end try return reader.getNumberOfPages() without the missing closing } you are just returning the fact that there is a reader object created as the getPages needs to be outside the try
Create an account or sign in to comment