PDF Pagecount Logic
Well its been long time and i put my developer hats ON. Small code atleast worked for me to solve my current problem. It works and its too fast and VFP again gets 100% credit.
Lparameter tcPdfFileName
lcPdf = Filetostr(tcPdfFileName)
Do Case
Case Left(lcPdf,8) = "%PDF-1.2"
lnPos = At("/Count", lcPdf)
lPageCount=Substr(lcPdf,lnPos+6,10)
lPageCount=Val(lPageCount)
Case Left(lcPdf,8) = "%PDF-1.4" Or Left(lcPdf,8) = "%PDF-1.5"
lPageCount=Occurs('/Page/',lcPdf)
Otherwise
lPageCount=0
Endcase
Return lPageCount
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home