Search Application no in pdf file
I have to find Application no from pdf file and save this no in database....
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Roei BarRank #1,271 · 1.4K reputationPosted Sep 4, 2009, 4:21 AM EDT
using Acrobat; using AFORMAUTLib; private void pdfRandD(string fPath) { AcroPDDocClass objPages = new AcroPDDocClass(); objPages.Open(fPath); long TotalPDFPages = objPages.GetNumPages(); objPages.Close(); AcroAVDocClass avDoc = new AcroAVDocClass(); avDoc.Open(fPath, "Title"); IAFormApp formApp = new AFormAppClass(); IFields myFields = (IFields)formApp.Fields; string searchWord = "Search String"; string k = ""; StreamWriter sw = new StreamWriter(@"D:\KCG_FileChecker_Inputs\MAC\pdf\0230_525490_23_cha17.txt", false); for (int p = 0; p < TotalPDFPages; p++) { int numWords = int.Parse(myFields.ExecuteThisJavascript("event.value=this.getPageNumWords(" + p + ");")); k = ""; for (int i = 0; i < numWords; i++) { string chkWord = myFields.ExecuteThisJavascript("event.value=this.getPageNthWord(" + p + "," + i + ", true);"); k = k + " " + chkWord; } if(k.Trim().Contains(searchWord)) { int pNum = int.Parse(myFields.ExecuteThisJavascript("event.value=this.getPageLabel(" + p + ",true);")); sw.WriteLine("The Word " + searchWord + " is exists in " + pNum); } } sw.Close(); MessageBox.Show("Process completed"); }in order to insert to db just execute an insert insted of the streamwriter
Mittal Joshi34 reputationPosted Sep 4, 2009, 10:26 PM EDT
Retrieving the COM class factory for component with CLSID {FF76CB60-2E68-101B-B02E-04021C009402} failed due to the following error: 80040154.
kais ksouri2 reputationPosted Oct 1, 2009, 7:43 AM EDT
var serchedWord = /(^| )de([^a-z]|$)/i;
var numWords, i, j;
for (var i = 0; i < 1; i++ )
{
numWords = this.getPageNumWords(i);
for ( j = 0; j < numWords; j++)
{
if (serchedWord.test(this.getPageNthWord(0,j,false)))
{
annot = this.addAnnot
({
page: i,
type:"Underline",
quads: this.getPageNthWordQuads(i,j),
strokeColor: color.red,
});
annot1 = this.addAnnot
({
page: i,
type:"Highlight",
quads: this.getPageNthWordQuads(i,j),
strokeColor: color.yellow,
});
}
}
}
Plase i'm used this code to mark some words on my pdf file bat the problem that makes so much time pealse any help ?