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 | 0 ... 1 public class PDFViewer extends ApplicationWindow 2 { 3 private OleControlSite site; 4 private OleAutomation auto; 5 6 public PDFViewer() 7 { 8 super(null); 9 this.addMenuBar(); 10 } 11 12 protected Control createContents(Composite parent) 13 { 14 Shell shell = this.getShell(); 15 shell.setText("PDF Viewer"); 16 shell.setSize(500, 450); 17 18 OleFrame frame = new OleFrame(shell, SWT.NONE); 19 20 try 21 { 22 site = new OleControlSite(frame, SWT.NONE, "PDF.PdfCtrl.5"); 23 auto = new OleAutomation(site); 24 25 ... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ... [java]Functions for PDF.PdfCtrl.5 : [java]METHOD (id = 2) : [java] Signature : boolean LoadFile([] String fileName) [java] Description : null [java] Help File : null [java]METHOD (id = 3) : [java] Signature : void setShowToolbar([] boolean On) [java] Description : null [java] Help File : null [java]METHOD (id = 4) : [java] Signature : void gotoFirstPage() [java] Description : null [java] Help File : null ... |
1 2 3 4 5 6 7 8 9 10 11 12 13 | ... <target name="activex" depends="package-common"> <java classname="Main" fork="true"> <jvmarg value="-Djava.library.path=${eclipse.dir}windows"/> <classpath> <pathelement location="${dist.dir}/pdfviewer.jar"/> <fileset dir="${eclipse.dir}" includes="*.jar"/> <fileset dir="${eclipse.dir}windows" includes="*.jar"/> </classpath> <arg value="<insert some program identifier>"/> </java> </target> ... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 0 ... 1 public void showPdfControl() 2 { 3 site.doVerb(OLE.OLEIVERB_SHOW); 4 } 5 6 public void loadFile(String file) 7 { 8 showPdfControl(); 9 10 int[] rgdispid = auto.getIDsOfNames(newString[]{"LoadFile"}); 11 int dispIdMember = rgdispid[0]; 12 13 Variant[] rgvarg = new Variant[1]; 14 rgvarg[0] = new Variant(file); 15 16 Variant pVarResult =auto.invoke(dispIdMember,rgvarg); 17 } 18... |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |