How to make image pdf to searchable without changing the format?
other details:
VS2010
.net 3.5
How to make image pdf to searchable without changing the format?
other details:
VS2010
.net 3.5
Hi Vigil,
private string CallBackGetHocr(System.Drawing.Image img)<o:p></o:p>
{<o:p></o:p>
string dir = @"c:\PdfTest";<o:p></o:p>
img.Save(dir + “test.jpg”);<o:p></o:p>
ProcessStartInfo info = new ProcessStartInfo(@“tesseract”);<o:p></o:p>
info.WindowStyle= ProcessWindowStyle.Hidden;<o:p></o:p>
info.Arguments = @“c:\pdftest\test.jpg c:\pdftest\out hocr”;<o:p></o:p>
Process p = new Process();<o:p></o:p>
p.StartInfo = info;<o:p></o:p>
p.Start();<o:p></o:p>
p.WaitForExit();<o:p></o:p>
StreamReader streamReader = new StreamReader(@“c:\pdftest\out.html”);<o:p></o:p>
string text = streamReader.ReadToEnd();<o:p></o:p>
streamReader.Close();<o:p></o:p>
return text;<o:p></o:p>
}<o:p></o:p>
public void Main<o:p></o:p>
{<o:p></o:p>
Document doc = new Document(“Input.pdf”);<o:p></o:p>
doc.Convert(CallBackGetHocr);<o:p></o:p>
doc.Save(“output.pdf”);<o:p></o:p>
}