Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

137
Vistas
changing the size of embedded PDF in javascript

noob here, I want the embedded PDF to appear with 100% width and 97,5% height but i cant figure it out

  <style>.size {
      width:100%;
      height:97.5%;
    }
  </style>
    <button type="button" id="show" onclick="PDFshow(this); classadd()" >PDF anzeigen</button>
    <div id="pdfsize"> 
    <script>
      function PDFshow(x) {
        x.style.visibility = 'hidden';      
        var x = document.createElement("EMBED");
        x.setAttribute("src", "Doku.pdf");
        document.body.appendChild(x); 
      }
    </script>
    </div>
  

    <script>
      function classadd() {
        var element = document.getElementById("pdfsize");
        element.classList.add("size");
      }
    </script>
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Add this after x.setAttribute("src", "images/application-form.pdf"); :

x.setAttribute("width", "100%");
x.setAttribute("height", "97.5%");

you can delete the css code of .size and add height on the body tag of 100vh.

about 4 years ago · Juan Pablo Isaza Denunciar

0

<button type="button" id="show" onclick="showPDF(this)" >PDF anzeigen</button>

<script>
  function showPDF(x) {
    x.style.display = "none";
    var x = document.createElement("EMBED");
    x.setAttribute("src", "Doku.pdf");
    x.classList.add("size");
    document.body.appendChild(x);
  }
</script>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda