c# - How do I copy the whole content of a pdf? -
helllo,
i want transfer pdf c# program using .net 3.5. know, there libs that, not allowed use such. came idea copy content of pdf file manually , transform datatable. because want work automatically using code:
process adope = new process(); adope.startinfo.filename = fd.filename.tostring(); adope.startinfo.arguments = fd.filename.tostring(); adope.start(); intptr adobe_handler = intptr.zero; while (elapsed_time.elapsedmilliseconds <= 5000) { adobe_handler = findwindow("acrobatsdiwindow", fd.safefilename + " - adobe reader"); if (adobe_handler != intptr.zero) { break; } system.threading.thread.sleep(200); } if (adobe_handler == intptr.zero) { messagebox.show("adobe not running"); return; } elapsed_time.stop(); clipboard.clear(); setforegroundwindow(adobe_handler); elapsed_time.start(); while (pdf_info.equals("")&&elapsed_time.elapsedmilliseconds<=10000) { clipboard.clear(); sendkeys.sendwait("^a"); sendkeys.sendwait("^c"); pdf_info = clipboard.gettext().tostring(); } elapsed_time.stop(); adope.close(); it works... sometimes. looking better way or improvement. idea?
thanks!
Comments
Post a Comment