[Vaadin 6] Open PDF to a specific page

Hi everybody,

I’m creating an embbedded object from an InputStream to open an PDF: so far it works :slight_smile: But I would like to do, it’s to open it to a specific page. After several test, I found that I should render something like this: <embed src="http://localhost:8080/eworkshop-admin/APP/3/FT12.pdf#page=8" /> Only problem, how do I generate the anchor “page” at the end of src tag?

Thanks for your help

PS: I know I could use the ITextPdf addon, but It’s too slow…

One solution I’ve found (not pretty, but it works) overriding Application.getRelativeLocation method:

  public String getRelativeLocation(ApplicationResource resource) {
    String uri = super.getRelativeLocation(resource);
    if(resource instanceof DocumentDtoResource
        && ((DocumentDtoResource)resource).isPDF()) {
      uri = uri.concat("#page=" + ((DocumentDtoResource)resource).getDocument().getPage());
    return uri;