Reputation: 593
I have a PDF file stored in server and I want to display it on the client side. How can I make the pdf displayed in the required place?
Upvotes: 2
Views: 6719
Reputation: 1
I have used following. Its working fine. May be its usefull for you.
GWT Client side:
HTML pdf = new HTML("<embed src='http://www.mydomain.com/path to my pdf' width='100%' height='500px'></embed>");
PDFPannel.add(pdf);
Upvotes: 0
Reputation: 5291
You can create a frame widget with a reference to your PDF file. The Frame widget in GWT will render an HTML iFrame in your browser.
public class FrameExample implements EntryPoint {
public void onModuleLoad() {
// Make a new frame, and point it at Google.
Frame frame = new Frame("http://www.mydomain.com/path to my pdf");
// Add it to the root panel. or anywhere you want
RootPanel.get().add(frame);
}
}
Upvotes: 6