public SinglePageLayout(Djvu_html5 app) {
    this.app = app;
    this.tileCache = app.getTileCache();
    this.pageCache = app.getPageCache();

    pageCache.addFullDecodeListener(this);
    tileCache.addTileCacheListener(this);

    this.canvas = app.getCanvas();

    this.background = app.getBackground();
    this.pageMargin = app.getPageMargin();

    new PanController();

    boolean pageParam = false;
    try {
      page = Integer.parseInt(Window.Location.getParameter("p")) - 1;
      pageParam = true;
    } catch (Exception e) {
      page = 0;
    }
    locationUpdateEnabled = pageParam || app.getLocationUpdateEnabled();
    pageCache.fetchPage(page);
  }