【发布时间】:2015-07-06 14:35:53
【问题描述】:
我试图复制这个example。
在我的 BundleConfig.cs 中:
<!-- language: c# -->
public static string KendoVersion = "2015.1.429";
public static string KendoTheme = "bootstrap";
bundles.Add(new StyleBundle("~/Content/kendo/kendoui").Include(
String.Format("~/Content/kendo/{0}/kendo.common.min.css",KendoVersion),
String.Format("~/Content/kendo/{0}/kendo.common-{1}.core.min.css", KendoVersion, KendoTheme),
String.Format("~/Content/kendo/{0}/kendo.common-{1}.min.css", KendoVersion,KendoTheme),
String.Format("~/Content/kendo/{0}/kendo.{1}.min.css", KendoVersion, KendoTheme)
));
我有这个简单的看法:
<div class="pdf">
Test <strong>Test2</strong>
</div>
<button class="export-pdf k-button" onclick="getPDF('.pdf')">Esporta in PDF</button>
<script type="text/javascript">
function getPDF(selector) {
kendo.drawing.drawDOM($(selector)).then(function (group) {
kendo.drawing.pdf.saveAs(group, "Richiesta.pdf");
});
}
</script>
如果我在本地环境中运行我的应用程序,我没有任何问题。但是,如果我远程发布到 IIS,当我单击“PFD”按钮时,我会遇到这个 JavaScript 错误:
无法从 myWebSite.it/TestPdf/Content/kendo/fonts/DejaVu/DejaVuSans.ttf 加载字体
文件在服务器中正确推送,正确路径为: "~/Content/kendo/2015.1.429/fonts/DejaVu/DejaVuSans.ttf"
如果我复制文件夹“~/content/kendo”中的文件夹字体,它可以工作。
问题
为什么应用程序有这种行为?
我是否在某处遗漏了一些配置?
【问题讨论】:
-
文件夹 2015.1.429 是干什么用的?
-
你在使用捆绑吗?
-
@gaynorvader 文件夹 2015.1.429 是我在 Telerik MVC 项目中转换我的项目时创建的。 “2015.1.426”是我正在使用的 Telerik 版本。
-
@ASG 是的。我使用捆绑,但我没有在任何地方声明字体 Dejavu。我认为函数“kendo.drawing”会自动知道字体在哪里。
-
@jebbo 你能把你的 css 包代码从 BundleConfig.cs 放上去吗?我认为您可能缺少捆绑包中的版本
标签: javascript css iis kendo-ui telerik