opening pdf-files at a specific page, bookmark or goal.
Hi,
I have a PDf-file which i can open when I click on a button. But, is it possible
to open a specific bookmark(Page) on this button click.
Here is the code to open a pdf file:
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
publicclass PdfOpenextends JFrame{
private JButton button =null;
public PdfOpen(){
init();
setVisible(true);
}
privatevoid init(){
getContentPane().add(getButton(), BorderLayout.CENTER);
pack();
}
private JButton getButton(){
if(button ==null){
button =new JButton("View");
button.addActionListener(new ActionListener(){
publicvoid actionPerformed(ActionEvent evt){
ViewButtonActionPerformed(evt);
}
});
}
return button;
}
privatevoid ViewButtonActionPerformed(ActionEvent evt){
open();
}
privatevoid open(){
try{
Runtime r = Runtime.getRuntime();
Process p = r.exec("rundll32 url.dll,FileProtocolHandler C:\\Documents and Settings\\PMISXP0\\Desktop\\facsgs_33.pdf");
}
catch(Exception e){
System.out.println(e);
}
}
publicstaticvoid main(String args[]){
PdfOpen pdfOpen =new PdfOpen();
}
}
Please help.
Thanks

