bonjour,
Je cherche à avoir le contrôle sur un activeX acrobat reader qui ouvre et ferme des fichiers PDF.
Pour l'instant j'ai un shell avec un frame et j'utilise un objet OleControlSite :
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 public void afficherPDF() { oleControlSite = new OleControlSite(frame, SWT.NONE, "Shell.Explorer"); oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE); oleAutomation = new OleAutomation(oleControlSite); int[] rgdispid = oleAutomation.getIDsOfNames(new String[] { "Navigate" }); oleControlSite.doVerb(OLE.OLEIVERB_DISCARDUNDOSTATE); if (oleControlSite.doVerb(OLE.OLEIVERB_SHOW) != OLE.S_OK) System.out.println("Verb error!"); else System.out.println("Verb ok!"); v = new Variant("C:/fichier.pdf"); oleAutomation.invoke(rgdispid[0], new Variant[] v}); System.out.println("invoke ok"); frame.setBounds(10,30, shell.getSize().x - 5, shell.getSize().y - 10); frame.setVisible(true); }
J'arrive effectivement à ouvrir mon pdf et l'afficher.
Cependant j'appel un web Browser, via "Shell.Explorer"
Connaitriez vous un appel à un activeX genre AcroExch.Document et sauriez vous le contrôler, c'est à dire pouvoir libérer le fichier ressource ?
Je rencontre des soucis rien qu'à utiliser AcroExch.Document.
Merci d'avance !
Partager