Adobe Acrobat Viewer

S

Sergio

Hi everyone. I'm in the edge of suicide... please I need help with
this:

I don't know if you have ever met this Java Bean that let's you
display PDF files it's the Adobe Acrobat Viewer for java that can be
downloaded here: http://www.adobe.com/products/acrviewer/acrvdnld.html
Ok? So:

I'm currently developing a project witch uses the Adobe Acrobat Viewer
Java Bean to display PDF Files, everything was going right but then I
reached a major obstacle that I can't overcome. To display a PDF file
the program uses this code:

public void renderFile(String FileName, int Page)
{
FileInputStream iStream;
Viewer ViewerWindow;
Viewer BaseViewer;
File PDFFile;

if(FileName == null) return;

PDFFile = new File(FileName);
if(!(PDFFile.exists())) return;

try
{
BaseViewer = new Viewer();
ViewerWindow = BaseViewer.openNewWindow();

iStream = new FileInputStream(PDFFile);
ViewerWindow.setDocumentInputStream(iStream);
}
catch(Exception ex)
{
return;
}

try
{
Page = Page - 1;

if(Page < 0 || Page > ViewerWindow.getPageCount()) Page = 0;

ViewerWindow.renderPage(Page);
}
catch(Exception ex)
{
return;
}
}

Off course the procedure has messages that alert the users about
errors but you are not interested in that right? Ok here's the problem
everything works ok until I call RenderPage, no matter what number I
pass to the function the Acorbat windows always freezes and I don't
know why this is more or less the same procedure used in the sample
program that comes inside the zip.

Any Ideas?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top