Developer Tools
|
Office Productivity Applications
|
Platform-Agnostic APIs
|
Home | Online Demos | Downloads | Buy Now | Support | About Us | News | Working Together | Contact Us
Gnostice XtremeDocumentStudio (for Java) is the next-generation multi-format document-processing component suite for Java SE/EE developers. Currently, it supports viewing, printing, and converting PDF, DOCX, BMP, JPEG, PNG, JPEG2000 and single-page/multi-page TIFF. XtremeDocumentStudio can process PDF and DOCX without requiring external software such as Microsoft Word, Open XML SDK, Adobe PDF library or GhostScript.
In this article, we will see how to create a simple document viewer application in using XtremeDocumentStudio and Swing.
DocumentViewerDemo
extending javax.swing.JFrame class. Ensure that the "New class" wizard automatically generates the main()
method stub too.this.setSize(900, 600);
addActionListener()
boiler-late code.actionPerformed()
method of the listener.
DocumentViewer viewer = (DocumentViewer) getContentPane().getComponent(1); try { viewer.loadDocument("Article.docx", ""); } catch (FormatNotSupportedException e) { e.printStackTrace(); } catch (IncorrectPasswordException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (XDocException e) { e.printStackTrace(); }This assumes that the viewer control is the second (index 1) on the content pane with the other control being the JButton (index 0). You can of course declare the
DocumentViewer
instance as a global variable. That way you can easily refer it in other methods. As your application becomes any more sophisticated than this, then a global declaration would be the only way to do it right.
main()
method, instantiate your JFrame and make it visible.
DocumentViewerDemo oWindow = new DocumentViewerDemo(); oWindow.setVisible(true);
This example demonstrated you how to create a simple document viewer application. The download file of XtremeDocumentStudio contains more elaborate source code demos for the viewer control.
---o0O0o---
Our .NET Developer Tools | |
---|---|
Gnostice Document Studio .NETMulti-format document-processing component suite for .NET developers. |
PDFOne .NETA .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications. |
Our Delphi/C++Builder developer tools | |
---|---|
Gnostice Document Studio DelphiMulti-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms. |
eDocEngine VCLA Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools. |
PDFtoolkit VCLA Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents. |
Our Java developer tools | |
---|---|
Gnostice Document Studio JavaMulti-format document-processing component suite for Java developers. |
PDFOne (for Java)A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications. |
Our Platform-Agnostic Cloud and On-Premises APIs | |
---|---|
StarDocsCloud-hosted and On-Premises REST-based document-processing and document-viewing APIs |
Privacy | Legal | Feedback | Newsletter | Blog | Resellers | © 2002-2024 Gnostice Information Technologies Private Limited. All rights reserved. |