PDF Viewer plugin AWT/SWT problem [message #278487] |
Mon, 03 January 2005 22:47 |
Bernd Hofner Messages: 68 Registered: July 2009 |
Member |
|
|
I'm looking for a way to display PDF files (usually just a one page
technical drawing) on one page of a MultiPageEditor.
Is there a simple to use PDF plugin around?
I Googled around a bit but couldn't find one.
I found a JavaBean from Adobe wich I tried to integrate, but this didn't
work out:
public class ToolFrameEditor extends MultiPageEditorPart
{
....
addPages() {
Composite composite = new Composite(getContainer(), SWT.EMBEDDED);
Frame awtFrame= SWT_AWT.new_Frame(composite);
awtFrame.setLayout(new BorderLayout());
try
{
pdfViewer= new com.adobe.acrobat.Viewer();
}
catch(Exception e)
{
e.printStackTrace();
}
awtFrame.add(pdfViewer);
try
{
FileInputStream in = new FileInputStream(myFileName);
pdfViewer.setDocumentInputStream(in);
idxPDFPage= addPage(composite);
setPageText(idxPDFPage, "PDF View");
pdfViewer.activate();
}
catch(Exception e)
{
e.printStackTrace();
}
}
The problem is that Adobe pops up a Licence Dialog as soon as the
com.adobe.acrobat.Viewer()
is created.
This dialog has the tendency to stay invisible, which would make
acknowleging it, hmm, difficult.
But even if it does show up, it doesn't react to mouse or keyboard input
(mouse cursor shows as hour-glass).
I guess this happens because the pdfViewer has not been added to the
awtFrame, yet, so that the SWT events
are not passed through.
Can anyone shed some light here?
Thanks,
Bernd
|
|
|