c# - itextsharp.NumberOfPages returns a wrong value -
i'm working on c# application , i'm using itextsharp(v5.5.2) read pdf documents.
have problem read pdf files because "pdfreader.numberofpages" attibute returns wrong value.
i.e.: document contains 18 pages(adobe reader) attribute "pdfreader.numberofpages" return 2.
when try code(for testing) text page page number
pdfreader reader = new pdfreader(fileinfo.fullname); pdfreadercontentparser pdfreadercontentparser = new pdfreadercontentparser(reader); itextextractionstrategy itextextractionstrategy = pdfreadercontentparser.processcontent(mypagenumber, new simpletextextractionstrategy()); string pdftext = itextextractionstrategy.getresultanttext();
, have results:
if mypagenumber = 1 => return text page 1 if mypagenumber = 2 => return text page 8!!! if mypagenumber = 3 => create error expected (the reader "see" 2 pages)
i discovered possible cause of problem i'm not sure of it: type of font type.
when have "type1" in document, don't have problems. have problem truetype font type. unfortunatly can't share problematic pdf files.
thank assistance.
Comments
Post a Comment