Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 3.0
-
Fix Version/s: 4.0 - Beta
-
Component/s: None
-
Labels:None
-
Environment:Windows
-
Workaround Description:
Description
I am displaying a PDF document with following code (from the constructor of a class that extends JFrame):
SwingController controller = new SwingController();
controller.setPageViewMode(DocumentViewControllerImpl.ONE_PAGE_VIEW, true);
DocumentViewControllerImpl vc = (DocumentViewControllerImpl) controller.getDocumentViewController();
vc.setDocument(doc);
vc.setCurrentPageIndex(currentPageIndex);
vc.setZoom(0.5F);
JScrollPane scroll = (JScrollPane) vc.getViewContainer();
panel1.add(scroll, BorderLayout.CENTER);
pack();
setLocationRelativeTo(getOwner());
Then, I would like to ViewContainer to show any page I want, by using the following code inside a button listener:
vc.setCurrentPageIndex(currentPageIndex);
Problem: whan I change the page this way, the viewContainer shrinks down to a very tiny area.
Put it in a different way: what is the right way to change the PDF page shown in the ViewContainer?
SwingController controller = new SwingController();
controller.setPageViewMode(DocumentViewControllerImpl.ONE_PAGE_VIEW, true);
DocumentViewControllerImpl vc = (DocumentViewControllerImpl) controller.getDocumentViewController();
vc.setDocument(doc);
vc.setCurrentPageIndex(currentPageIndex);
vc.setZoom(0.5F);
JScrollPane scroll = (JScrollPane) vc.getViewContainer();
panel1.add(scroll, BorderLayout.CENTER);
pack();
setLocationRelativeTo(getOwner());
Then, I would like to ViewContainer to show any page I want, by using the following code inside a button listener:
vc.setCurrentPageIndex(currentPageIndex);
Problem: whan I change the page this way, the viewContainer shrinks down to a very tiny area.
Put it in a different way: what is the right way to change the PDF page shown in the ViewContainer?
Unless I hear otherwise I'm closing this issue as I cannot reproduce the issue, and believe it stems from a misconstructed viewer component.