Start a new topic

A4 HtmlDrawable

A4 HtmlDrawable


Hi,

I am struggeling to get a WebPage displayed as an overlay over my DIN A4 Document (21cm * 29.7cm) that I scan.

This is the code:


        var fullscreen = new AR.HtmlDrawable({
            uri: "assets/default.html"
        }, 1, {
            viewportWidth: 210,
            viewportHeight: 297,
            horizontalAnchor: AR.CONST.HORIZONTAL_ANCHOR.LEFT,
            verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP,
            clickThroughEnabled: true,
            allowDocumentLocationChanges: false,
        });

I get a small little document in the lower right center of my target. Why?

I want the HtmlDrawable to cover the entire target.

My solution:

        var fullscreen = new AR.HtmlDrawable({
            uri: "assets/default.html"
        }, 1, {
            viewportWidth: 210,
            viewportHeight: 297,
            offsetX: -0.3,
            offsetY: 0.42,
            horizontalAnchor: AR.CONST.HORIZONTAL_ANCHOR.LEFT,
            verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP,
            clickThroughEnabled: true,
            allowDocumentLocationChanges: false,
        });

In default.html:

<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body  style='margin: 0'>
    <div  style='position: fixed; top: 0; left: 0; background-color: green; margin: 0; width: 583px; height: 825px'>
    <!--Content in here will be placed over the DIN A4 document-->
    </div>
  </body>
</html>
Login or Signup to post a comment