Hello tlm
Je cherche deja depuis un moment comment rechercher du text dans un fichier PDF
est ce que qqun peut m’aiguiller sur une solution SVP ??
Je n'aboutis pas a grand chose.
merci
Je bosse sur VB.net 2010
MERCI D'avance
Hello tlm
Je cherche deja depuis un moment comment rechercher du text dans un fichier PDF
est ce que qqun peut m’aiguiller sur une solution SVP ??
Je n'aboutis pas a grand chose.
merci
Je bosse sur VB.net 2010
MERCI D'avance
Le problème avec pdf est qu'il n'y a ni paragraphes, ni mots, juste des caractères (glyphs) avec leur position x,y.comment rechercher du text dans un fichier PDF
Trouver des mots ou du texte et les associer à une zone d'une page dépendra des possibiltés la biblithèque Pdf utilisée.
Quel est l'objectif de la recherche ?
" Le croquemitaine ! Aaaaaah ! Où ça ? " ©Homer Simpson
hello
mot objectif est simplement de vérifier que d'un fichier pdf une chaine de caractére existe
donc j'ai trouvé comment faire , en inserez un Composant acrobat reader
référence : interop.acrobat.dll et une autre axinterop ....
J'ouvre le fichier pdf
Je focus
CTRL-A + CTRL C
copie en memoire
et recherche de ma chaine de caractere
donc ca marche
mais j'ai fait cette simule sur un nouveau projet
et je veux faire cette fonction sur mon projet en cours
il me jete avec une erreur suivante
je ne comprend pas du tout pourquoi
ce qui est dommage c'est d'avoir trouvé une solution et de pas pouvoir la reporduire sur le projet en cours
voila
si tu as une idée
MErci
++
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 L'exception System.InvalidOperationException n'a pas été gérée Message=Une erreur s'est produite lors de la création du formulaire. Pour plus d'informations, consultez Exception.InnerException. L'erreur est*: Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG)) Source=ILO_GENERATION_XLS StackTrace: à ILO_GENERATION_XLS.My.MyProject.MyForms.Create__Instance__[T](T Instance) dans 17d14f5c-a337-4978-8281-53493378c1071.vb:ligne 190 à ILO_GENERATION_XLS.My.MyProject.MyForms.get_Form1() à ILO_GENERATION_XLS.My.MyApplication.OnCreateMainForm() dans C:\Users\sbaudet\Documents\Visual Studio 2010\Projects\ILO_GENERATION_XLS\ILO_GENERATION_XLS\My Project\Application.Designer.vb:ligne 35 à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() à Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) à ILO_GENERATION_XLS.My.MyApplication.Main(String[] Args) dans 17d14f5c-a337-4978-8281-53493378c1071.vb:ligne 81 à System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) à System.Threading.ThreadHelper.ThreadStart() InnerException: System.Runtime.InteropServices.COMException Message=Classe non enregistrée (Exception de HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG)) Source=System.Windows.Forms ErrorCode=-2147221164 StackTrace: à System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid) à System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid) à System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid) à System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid) à System.Windows.Forms.AxHost.CreateInstance() à System.Windows.Forms.AxHost.GetOcxCreate() à System.Windows.Forms.AxHost.TransitionUpTo(Int32 state) à System.Windows.Forms.AxHost.CreateHandle() à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) à System.Windows.Forms.AxHost.EndInit() à ILO_GENERATION_XLS.Form1.InitializeComponent() dans C:\Users\sbaudet\Documents\Visual Studio 2010\Projects\ILO_GENERATION_XLS\ILO_GENERATION_XLS\Form1.Designer.vb:ligne 537 à ILO_GENERATION_XLS.Form1..ctor() dans C:\Users\sbaudet\Documents\Visual Studio 2010\Projects\ILO_GENERATION_XLS\ILO_GENERATION_XLS\Form1.vb:ligne 523 InnerException:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click Timer2.Start() End Sub Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click ' Clipboard.Clear() ' MsgBox(Clipboard.GetText) AcroPDF1.Focus() SendKeys.Send("^{a}") SendKeys.Send("^{c}") End Sub Private Sub Timer2_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer2.Tick Timer2.Stop() Select Case tick Case 0 Clipboard.Clear() AcroPDF1.LoadFile("c:\fichierpdf.pdf") tick = tick + 1 Timer2.Start() Case 1 AcroPDF1.Focus() SendKeys.Send("^{a}") SendKeys.Send("^{c}") tick = tick + 1 Timer2.Start() Case 2 If InStr(Clipboard.GetText, "toto") <> 0 Then MsgBox("trouvé") End If tick = 0 End Select End Sub
Bonjour,
Tu n'as pas changé de poste de développement entre ton projet en cours et ton nouveau projet ? (Par ex un x32 et un x64)
L'erreur importante dans ton exception est HRESULT : 0x80040154 (REGDB_E_CLASSNOTREG) et peut avoir plusieurs sources (dll x32 pour x64, ocx a installé avec rgsrv32, etc etc) cherche un peu sur Google pour voir des problèmes similaires au tien : Voir ici
Aider les autres, c'est encore la meilleure façon de s'aider soi-même. Martin Gray
ToDo : Faire une ToDo List
non je n'est pas changer de poste de développement
Je regarde tes lien
Merci encore de ton aide
Bon j'ai trouvé grace a tes indication
dans generer / gestionnaire de configuration j'ai déclaré le projet en plateforme X86 et c'est bon
Merci bien de ton aide
a++
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager