javascript - 使用 KENDO 的 Jquery Grid 打印 PDF 时出现奇怪的字符
问题描述
我正在使用 Kendo 的 Grid for Jquery 开发一个包含许多列的表。包括 Kendo 提供的以 .xlsx 和 .pdf 格式打印表格的按钮,问题在于 PDF 打印机。看一下 PDF 的 doc 属性:
我正在尝试从生成的 PDF 的属性中删除此特殊字符 ('þÿ')。至少来自“标题”(título,在最后一张图片中)。这是我的代码:
用于 PDF 的“页面模板”:
<script type="x/kendo-template" id="page-template">
<div class="page-template">
<div class="header">
<h3 align="center" style="margin: 1px;"><strong>Cuenta Corriente: Vista Composición</strong></h3>
<div style="display: flex; flex-direction: column; justify-content: flex-start; align-content: flex-start;">
<p style="margin: 1px;">Cuenta Correntista: `v-cuit` , `v-desRazonSocial`.</p>
<p style="margin: 1px;">Fechas Consulta: `vFdesde` al `vFhasta`.</p>
<p style="margin: 1px;">Solicitado por: `AsamaUsuarios.ident_usua`.</p>
</div>
</div>
<div class="footer">
Página #: pageNum # de #: totalPages #
</div>
</div>
JavaScript 代码:
$(document).ready(function() {
$("#grid").kendoGrid({
sortable: true,
noRecords: true,
messages: {
commands: {
search: "Buscar..."
}
},
toolbar: ["search","excel", "pdf"],
excel: {
fileName: "ComposicionCtaCte.xlsx"
},
pdf: {
title: "Composicion Cta Cte",
fileName: "ComposicionCtaCte.pdf",
date: new Date(),
allPages: true,
avoidLinks: true,
template: $("#page-template").html(),
paperSize: ["525mm", "355mm"],
margin: {
top: "4.5cm",
left: "1cm",
right: "1cm",
bottom: "2cm",
},
landscape: true,
repeatHeaders: true,
scale: 1,
},
需要说明的是:指定 charset = UTF-8 的元标记已包含在源代码中。
解决方案
推荐阅读
- sql-server - 为什么 Azure SQL Server 连接器在插入行时询问我具有默认值的列的值?
- react-native - React Native Maps - 显示UserLocation不起作用
- angular - 将参数传递给Angular服务中的函数(可观察对象)?
- ag-grid - api.getSelectedNodes() 不参考网格配置
- c - 如何将 .gcda 文件内容传输到另一个文件中?
- c++ - windows 使用 long int 就像在 32 位机器中一样,而在 64 位
- r - (MICE) 具有时间因素的数据集的缺失数据插补(纵向数据)
- html - 基于内容的php echo span样式颜色
- angularjs - 使用 ng-pattern 匹配密码会在 HTML 中公开密码
- css - 如何保护 React 组件免受全局样式的影响?