使用javascript在浏览器窗口中打开pdf字符串时,图像变形

时间:2019-07-03 10:02:29

标签: javascript rest jsp scriptlet wcs

我想使用JavaScript从WebSphere Commerce中的调用中打开一个pdf字符串。 首先,我通过如下所示的rest调用获取pdf字符串。

self.innerViewHeightConstraint.constant = 60.0
UIView.animate(withDuration: 0.3) {
    self.view.layoutIfNeeded()
}

然后我按如下所示转义JS字符

<wcf:rest var="invoicePdf" format="raw" url="${InvoicePdfAPI}" scope="request">
                <wcf:header name="Authorization" value="Basic ${authString}" />
                <wcf:var name="customerId" value="${custId}" />
                <wcf:var name="id" value="${id}" />
</wcf:rest>

现在,我在单击下面的JS的按钮时打开pdf字符串。

<% 
    String pdfStringSession=(String)(request.getAttribute("invoicePdf"));
    request.setAttribute("invoicePdfFormattedString",StringEscapeUtils.escapeEcmaScript(pdfStringSession));
%>

pdf可以完美生成,但是pdf文件中有一张图像会变形并变成黑色。

任何帮助将不胜感激。

0 个答案:

没有答案
相关问题