Skip to content

Improve control over display of canvas #2

Description

@mmarras

I want to make a two column page layout, some Dash stuff left, the PDF right. Below a minimal example of the generated DOM:

<html>
  <head>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">  
  </head>
  <body>
    <div class ="container">
      <div class="row">
        <div class="col-6">
          <div id="pdf-viewer">
            <div class="react-pdf__Document" style="--scale-factor: 1">
              <div
                class="react-pdf__Page"
                data-page-number="1"
                style="
                  --scale-factor: 1;
                  background-color: white;
                  position: relative;
                  min-width: min-content;
                  min-height: min-content;
                "
              >
                <canvas
                  class="react-pdf__Page__canvas"
                  dir="ltr"
                  width="850"
                  height="1063"
                  style="display: block; user-select: none; width: 567px; height: 709px"
                ></canvas>
              </div>
            </div>
            <div class="d-flex">
              <p class="">Page 1 of 4</p>
              <button type="button" disabled="" class="btn btn-outline-primary">
                Previous</button
              ><button type="button" class="btn btn-outline-primary">Next</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

I want the pdf to take up all the space of the column, how to remove the <canvas> style properties? The provided class handles only allow to tweak the buttons. Better not to enforce style tag anyways and let users define classes for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions