【发布时间】:2017-04-18 20:28:51
【问题描述】:
我在我的应用程序中生成了条码。打印条码和导出 pdf 文件时存在一些问题。在这种情况下,条码未显示在打印或 pdf 文件中。我使用 angularjs js 按指令生成条码。
这是我的 JavaScript
$scope._printBarCode = function (printSectionId) {
var innerContents = document.getElementById(printSectionId).innerHTML;
var popupWinindow = window.open();//'', '_blank');
popupWinindow.document.open();
popupWinindow.document.write('<html><head><link rel="stylesheet" type="text/css" href="Content/assets/css/barCode.css" /></head><body onload="window.print()">' + innerContents + '</html>');
popupWinindow.document.close();
}
这是我的 html
<input type="button" value="Prnt" ng-click="_printBarCode('barCodeId')" class="btn btn-primary" />
<div class="barcodeplace">
<div class="col-sm-12">
<div barcode-generator="{{_barCodeGeneraterId}}" style="height:20px;">
</div>
</div>
</div>
【问题讨论】:
标签: javascript angularjs pdf-generation