使用javascript将带图像的HTML导出为图像

时间:2015-10-17 15:27:56

标签: javascript excel export

我正在使用bootstrap和一些库 即时通讯使用此代码(在javasript中)

        window.open('data:application/vnd.ms-excel,' + encodeURIComponent($('#report_details').html()));

我也在表中使用QR码 QR码|项目|计数 [QRimg] |信息|信息

当我导出它时一切正常但是当我打开它时图像根本没有显示(在Excel程序中) 图像格式为base64 / png

<div class="panel-body" id="report_details" style="min-height: 10em; max-height: 30em;    overflow-y: scroll;overflow-x:scroll"><div class="pageContentWrapper"><h4 style="text-align:left;color:black"><u>17.10.2015</u></h4><h2>Deficiencies Report</h2></center><hr><br><br><table id="fill" width="100%" style="color:black  border-collapse: separate; border-spacing: 0 5px; /* this is the ultimate fix */"><tbody><tr style="border-bottom:2px solid black"><td>QR Code</td><td>Barcode</td><td>Item Name</td><td>Catagory</td><td>Min</td><td>Max</td><td>Quantity</td><td>Diff</td></tr><tr><td id="_680" data-includeqr="true" data-barcode="_680" title="_680"><br><canvas width="64" height="64" style="display: none;"></canvas><img src="data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAACOklEQVR4Xu2a3XKFMAiEzfs/tB170eZYyXwrxJ/O9rKTQ3BZYEHbsizrUvy3rr8mW2s/1vv/91eqZyrd3bwzAJWIbrZey4CIogQgQmOV9pnzkc+9n9uZjxQwAF3xIlHPRGg2Y9IM2FPlyCDJddUOcTy6N/rt6HyYAqrjUURVOwYgQKAKYFwE1ciRnM6cMQCBoswEatgGM4arJO+MInt5CqhAugj+tyL4WgbcpQRJta+S7I+cBQwAaHfTGKDSXtXealtTNf8Z/2/bCKlUJ8XUAJxAoK2ZhAIXZiI32bVv7w2AGZDgWURv1SSxkymaw41QhgHEcVAmFmLHAIgCiQD2pwiSiq2KGcKA/gyxH22jyV379PzoAgago1mVzCVRuZUB5OUooWXVwjMCQ90UUeDRLGAAwPv+1zIg0gFVD0Q2xFU14Mz4HM4CBiDxaYsK3iMZEIkNQmlCRTIvEIlMq33YRcgsoEbUAARdI9Pj1d9SZrxmIZJJhxGDDQCpAZROR+fIgKXOHWo6DBlAZgEVAFLhVZtqCtDzaBZQnTUAic/tyNRHUuAUAzKRoyuoowdU7yUPR/2Z/qUoKYIGQEyZSxigRo7IZbLMJDJaHZ5wG5xxeaaoVQXBAAxG++nfChPaEyWoahGakgagl8KzawDJaSJyCBtexQBVB6iFdQTYI1LAAIhC6BIGkDybvTgl3YFo/hHDps8CBKRMcTQA4ocTe1ZduhAhrYmwQX1ZO2qtBuDKnaAZIL5vrOoCoxT4Ao68COAjzKcAAAAAAElFTkSuQmCC" style="display: block;"></td><td>680</td><td>Pen Package</td><td>Office Supplies</td><td>100</td><td>1000</td><td>100</td><td class="text-warning"><b>0</b></td></tr><tr style="background-color:#DFE0E1"><td id="_921" data-includeqr="true" data-barcode="_921" title="_921"><br><canvas width="64" height="64" style="display: none;"></canvas><img src="data:image/gif;base64,R0lGODdhSgBKAIAAAAAAAP///ywAAAAASgBKAAAC/4yPqcvtD6OctNqLs968+w+G4kiWZgKk6roaLMC0QerC84tTeH7Liky71Xa+SDBmqyGOPVuR+UsapdGllAlUWR3QR/ClPHxZ2+Z4qBVOxtkyWOwkq99dbry9wKbPcDRfwrZH1QfHp+cXp3MniGaFFxZGN2iHGJlWqQY5J1fX0Gm5U7WpKQo4SUg0aJjoeYqUumopuwnrmlfLGjtKC3vS2vXpW1FEOoK7+LerB2z72mvGOrus2nzraNsZXNY4fHVpDQ4xrXitmRUIilxNWRjdxI13/o0Riopdnaz9KzeLJO6ur9S7TCi+5TuFbo23ZOXsbSvIzdS/QE8E1Sr2b6K6ce/Q6gUE59FdOjeLHkrsmItaRGUG1xUk1i6KPEwzu8FcSdOiTpxeFhIhyZPkoynX6kmbBxEaxlYCdR2Et9FlsUMszZXkdZOpvYPHqJpUKBRgV6+ELDBMSnVaQqNECYpK63Mtj5OI3kyNynapv3ZsmdX9mVRETah3hcUcSNitYrO4lmbjlPJjUcCPnTlFmlEr3Icws9IF6c1qw9EXKEYG/JYy5p45/2Y1PRisUpbyyLIjN3tV7dBtcUvC5Fj12cy/ZwcPOZy15pZkdfPGvbdi89NfNaYCqlzmalMXHWZ/ud2w+PHky5s/jz69+vXs23coAAA7" style="display: block;"></td><td>921</td><td>Bristol</td><td>Paper</td><td>0</td><td>250</td><td>0</td><td class="text-warning"><b>0</b></td></tr><tr><td id="_1234" data-includeqr="true" data-barcode="_1234" title="_1234"><br><canvas width="64" height="64" style="display: none;"></canvas><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAACx0lEQVR4Xu1b4ZqDIAzT939o79s+3dWtJCnlnJ7dzw0QQkib4uZpmpYp+VmW3yHmeYaj2bbvDW1f1O7Rjz1HXdJjtgXAAy2GuIfotgstBmzfe7vlPc9jQIsV3rPlXTcsfTGgADDnOIrkv2MAEhhvsQwAC2iUupEjEJ33U0w3EVSVvABwQl5LP9Bus5DHmMIE+P0YtzZ4OANUuhcAJhShkBhh1yk0AOULNt9QGWDHi+jPKY7ANolIguP12b47DIDReYCnC97ORoBiIonWYJ9zSCZYABgEkC/4KgNU2nvtWCaoLkxtdxk77LnBEd8NBWDpsYGALiy8ocigJlEZtn4UYQqAYsBnISCaUqpOskVdNRVmdUBWZXKzVO8IFACgsptJR0/JAK8gksnhe8xQJtdntEdht1kRKgDEQMuqMmx3kGVFrpDZalaGP50Z8o5AAbAi0IpIakqN9OWpAZkwqO5Sxg6Lp3HXjJmq3XxuD8CIewGLaFT4rKAxM6Qarcg4Q8riBYBB4LIM8MSGmRx0/Z1lRc98UJ/mHSN6QeJWALDFquGop7zQU+JGWWjEsIVFkAFRAAx60YIBfTgDmK1kNhgZH/UanYGSEkGmAbcCACHN6nIs/KljqyG2J1zuNhtVhKK0RjRX6BsxMWg8lc1PN3h7AI64GGEVGs9WZzQnko679QCFrq02Ko3ZJAuANZ+IWOCecDr8ZWnVizOhUtWdjcOiSQEQjQJsh73f2W6q4Zb5DPXtk90cC4D1DxMMXbRLrb7qJevpGKBOnN0MZcLpqL6yCDI13SYUKTaMWkRmnNMBwCbkAZ05Ioyl4YpQlgEFgJPh/WWY/CoDUGRhKS6bODoqzHzR6/FRUeCyAKiqy8rZ7HelOtSKTqpbZEwKF0R6UuFRSRaz2shit4AsAEb/d1g1Q7ZdRitYjsDC7iF2mGlKAQBuk1i4zDLgByu18BmMxEaeAAAAAElFTkSuQmCC" style="display: block;"></td><td>1234</td><td>A4 Photography</td><td>Paper</td><td>3</td><td>12</td><td>3</td><td class="text-warning"><b>0</b></td></tr></tbody></table></div><br><div style="text-align:center">Footer</div></div>

0 个答案:

没有答案