asp.net-mvc - ASP.NET - SVG 到 PDF
问题描述
我正在尝试将存在文件 svg 的视图转换为 PDF。见下图。 在此处输入图片描述 看到“Febraban”这个词消失了……有人知道为什么吗?如果图像来自 PNG,系统运行完美,但格式为 .svg 不 :(
请参阅以下代码:
CSHTML:
<html>
<head>
@Styles.Render("~/Content/Site.css")
<title>Certificado</title>
</head>
<body>
<table style="width:100%; height:100%;">
<tr>
<td style=" background: #e4e4e2 url('../../Content/Imagens/Imagem_Direita_AQ.svg') top right no-repeat; background-size: auto 100%; text-align: center;">
<h1 class="txt-font-certificado">C E R T I F I C A D O</h1>
<p class="txt-18-preto">
Declaremos que
</p>
<p class="txt-30-azul-Participante">
ÉLITA BORGES SIMIONATO
</p>
<p class="txt-18-preto">
participou do
</p>
<p class="txt-20-azul-evento">
8º Congresso Combate e Prevenção a Lavagem de Dinheiro
<p align="center" class="txt-20-azul-evento">e ao Financiamento do Terrorismo</p>
<p class="txt-18-preto">
de 7/6 a 12/6/18, na cidade de São Paulo/SP,
</p>
<p class="txt-18-preto">
promovido pela Federação Brasileira de Bancos.
</p>
<p class="txt-18-preto">
Carga horária: 18 horas.
</p>
<br />
<img class="txt-assinatura" src="~/Content/Imagens/Assinatura.png" />
</td>
</tr>
</table>
@using (Html.BeginForm("Gerar", "Pdf", FormMethod.Post))
{
<button type="submit">Gerar PDF</button>
}
</body>
</html>
控制器:
public class PdfController : Controller
{
[HttpGet]
public ActionResult Certificado()
{
return View();
}
public ActionResult Gerar()
{
return new ActionAsPdf("Certificado")
{
PageSize = Rotativa.Options.Size.A4,
PageOrientation = Rotativa.Options.Orientation.Landscape,
PageMargins = new Rotativa.Options.Margins(0, 0, 0, 0),
FileName = Server.MapPath("~/Content/Certificado.pdf")
};
}
}
我希望你能帮助我!
解决方案
推荐阅读
- go - Go 中的并行表驱动测试惨遭失败
- r - ggplot 中是否提供时间序列过滤?
- c++ - C++ 解析文件时抛出 istream 特定错误
- r - 带有条件的 geom_point 中的颜色分配
- excel - 基于具有唯一标识符 (VBA) 的范围突出显示重叠日期
- microsoft-graph-api - 如何使用 Graph REST API 在 Azure AD 中更新用户的租用日期属性?
- spring-boot - 单元测试 ListenableFuture kafkaTemplate.send 总是返回 null
- python - Matplotlib - 条形图上的百分比
- sql - 获取与一个城市不同的员工订单数量
- azure-devops - Azure DevOps - 查询以按分支查找工作项