小编kin*_*nnu的帖子

如何去除zxing生成的QRCode的边距?

我正在使用 com.google.zxing 版本 3.3.2 使用 jasper 报告生成 QRCode。生成的 QRCode 有空格和边距。我怎样才能避免这些空间。

我找到了添加 EncodeHintType.MARGIN, -1 的解决方案,但如何在 jasper 报告的图像表达式中添加它。

下面是我现在使用的图像表达。

com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
new com.google.zxing.qrcode.QRCodeWriter().encode(
    $F{Code},com.google.zxing.BarcodeFormat.QR_CODE, 300, 300))
Run Code Online (Sandbox Code Playgroud)

java qr-code jasper-reports zxing

6
推荐指数
1
解决办法
8698
查看次数

如何在模式中显示pdf而不是在react js中的新窗口中打开它

我已经使用react js中的blob文本创建了一个pdf文件,并使用“window.open(fileURL,“_blank”)”我可以在新窗口中查看pdf。

但现在我的要求只是在 ui 中将 pdf 显示为模态,当单击模态时可以在另一个窗口中查看它。任何人都可以帮忙解决这个问题吗?

下面是我的代码片段:

var oReq = new XMLHttpRequest();

 var URLToPDF = baseUrl+"/downloadPDF

  oReq.open("GET", URLToPDF, true);

oReq.responseType = "blob";
var that = this;
oReq.onload = function() {

    const pdfFile = new Blob([oReq.response], { type: 'application/pdf' });

    const fileURL = URL.createObjectURL(pdfFile);

     window.open(fileURL, "_blank");

};
   oReq.send();
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-native

1
推荐指数
1
解决办法
1万
查看次数