首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将react-barcode转换为pdf格式进行打印

将react-barcode转换为pdf格式进行打印
EN

Stack Overflow用户
提问于 2017-12-08 14:34:41
回答 0查看 916关注 0票数 0

我试图打印生成的条形码,但它打印为对象,对象尝试使用JSON.stringify和所有其他来源,但不起作用。有人能建议一下做这件事最好的方法吗?

代码语言:javascript
复制
    var printWindow = window.open('', '', 'height=400,width=800');
    printWindow.document.write('<html><head><title>DIV 
         Contents</title>');
    printWindow.document.write('</head><body >');
    for(var i=0; i<selectedRows.length;i++){
        printWindow.document.write(
            <Barcode
            value="Rakesh"//{this.state.value}
            width="2"
            height="100"
            format="CODE128"
            displayValue=""
            fontOptions=""
            font="monospace"
            textAlign="center"
            textPosition="bottom"
            textMargin="2"
            fontSize="20"
            background="#ffffff"
            lineColor="#000000"
            margin="10"
            marginTop=""
            marginBottom=""
            marginLeft=""
            marginRight=""
        />
        );
    }
    printWindow.document.write('</body></html>');
    printWindow.document.close();
    // printWindow.print();
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47708955

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档