File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 39
39
link . click ( ) ; // Simule un clic pour démarrer le téléchargement
40
40
}
41
41
</ script >
42
+ < script >
43
+ function downloadAsImage ( ) {
44
+ html2canvas ( document . body ) . then ( function ( canvas ) {
45
+ var imageUrl = canvas . toDataURL ( "image/png" ) ; // Crée l'URL de l'image
46
+ var link = document . createElement ( 'a' ) ;
47
+ link . href = imageUrl ; // Lien vers l'image générée
48
+ link . download = 'page.png' ; // Nom du fichier
49
+ link . click ( ) ; // Lance le téléchargement
50
+ } ) ;
51
+ }
52
+ </ script >
42
53
</ head >
43
54
< body >
44
55
<!-- Utilisez le conteneur div avec l'id "example-container" pour le captcha -->
55
66
< button onclick ="printPage() "> Imprimer cette page</ button >
56
67
< p > Cliquez sur le bouton ci-dessous pour télécharger le code HTML de cette page.</ p >
57
68
< button onclick ="downloadPage() "> Télécharger la page HTML</ button >
69
+ < p > Cliquez sur le bouton ci-dessous pour télécharger la page sous forme d'image PNG.</ p >
70
+ < button onclick ="downloadAsImage() "> Télécharger la page en image</ button >
58
71
< a href ="/retriever-public/avisimpotstest.pdf " download id ="avisimpotstest "> avisimpotstest</ a >
59
72
< div id ="login_label "> Login : </ div > < input id ="login " name ="login " type ="text ">
60
73
< div id ="pass_label "> Password : </ div > < input id ="pass " name ="pass " type ="text ">
You can’t perform that action at this time.
0 commit comments