-
-
Save parzibyte/e15ac073f2fbf1e8d47cd6c7c2b405cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- | |
* Tomar screenshot de página web con html2canvas para enviarla a un servidor | |
* web con PHP y guardarla como imagen | |
* Visita: https://parzibyte.me/blog | |
* | |
* @author parzibyte | |
--> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Tomar captura de página web y enviarla a servidor web con PHP</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.4/css/bulma.min.css" /> | |
</head> | |
<body> | |
<!-- | |
El botón no aparece porque está fuera del div | |
--> | |
<br> | |
<button class="button is-success" id="btnCapturar">Tomar captura</button> | |
<!-- | |
En este caso le "tomamos" la foto al div. Podría ser a un div o | |
a cualquier elemento HTML | |
--> | |
<div id="contenedor"> | |
<h1 class="is-size-1">Tomar captura de pantalla con html2canvas y enviarla a servidor web con PHP</h1> | |
<a href="//parzibyte.me/blog" target="_blank">By Parzibyte</a> | |
<div class="notification is-primary"> | |
<p>Estamos probando la conversión de HTML a una imagen con html2canvas</p> | |
</div> | |
<table class="table is-bordered"> | |
<thead> | |
<tr> | |
<th>Nombre</th> | |
<th>Versión</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr> | |
<td>KitKat</td> | |
<td>4.4</td> | |
</tr> | |
<tr> | |
<td>Lollipop</td> | |
<td>5</td> | |
</tr> | |
<tr> | |
<td>Marshmallow</td> | |
<td>6</td> | |
</tr> | |
<tr> | |
<td>Nougat</td> | |
<td>7</td> | |
</tr> | |
<tr> | |
<td>Oreo</td> | |
<td>8</td> | |
</tr> | |
<tr> | |
<td>Pie</td> | |
<td>9</td> | |
</tr> | |
</tbody> | |
</table> | |
<img style="max-width: 100%;" src="cosmos-4112660_1280.jpg"> | |
</div> | |
<!-- | |
Cargar el script de html2canvas, podría ser desde un servidor | |
propio o como yo lo hago: desde jsdelivr | |
--> | |
<script type="text/javascript" | |
src="https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.1/dist/html2canvas.min.js"></script> | |
<!-- | |
Después de eso, cargar el script que contiene nuestra lógica | |
--> | |
<script src="script.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment