Genexus - PDF 报告(Web)中不显示字体

Posted

技术标签:

【中文标题】Genexus - PDF 报告(Web)中不显示字体【英文标题】:Genexus - Fonts doesn't show in PDF Report (Web) 【发布时间】:2021-12-30 09:59:16 【问题描述】:

GX Evo2 - .NET 应用程序:

我正在尝试打印一个包含 6 种不同字体的 pdf 报告,它还具有 html 操作。

一些变量的字体没有显示,大小的变化也不适用。

我无法让 Bahnschrift 显示 Condensed 或 SemiCondensed

我在 PDFReport.ini 下方留下了一些可能“有问题”的变量示例;尽管它不仅仅发生在 &Vars 上,其中包含 HTML:

1.

Embeed Fonts= true
RunDirection= 2
OutputFileDirectory= .
LeftMargin= 0.1
SearchNewFonts= false
BottomMargin= 0.1
LongDotDashedStyle= 6;2;1;2
DEBUG= false
Version= 1.0.0.0
Barcode128AsImage= false
DottedStyle= 1;2
SearchNewFontsOnce= true
ServerPrinting= false
AdjustToPaper= true
DashedStyle= 4;2
TopMargin= 0.8
Leading= 2
LongDashedStyle= 6;2
LineCapProjectingSquare= true
FontsLocation= C:\WINDOWS\Fonts
Fonts Location (MS)= C:\WINDOWS\Fonts

[Fonts Location (MS)]
Arial Narrow= C:\WINDOWS\Fonts\ARIALN.TTF
Tahoma= C:\WINDOWS\Fonts\TAHOMA.TTF
3 of 9 Barcode= C:\WINDOWS\Fonts\3OF9.TTF
BarCode 128= C:\WINDOWS\Fonts\barcode128.TTF
Bahnschrift SemiCondensed= C:\Windows\Fonts\Bahnschrift.ttf
Bahnschrift Condensed= C:\Windows\Fonts\bahnschrift.ttf
Bahnschrift= C:\Windows\Fonts\Bahnschrift.ttf
Calibri Light= C:\Windows\Fonts\calibril.ttf
Arial Black= C:\Windows\Fonts\ariblk.ttf

[Embeed Fonts]
3 of 9 Barcode= true
BarCode 128= true```


2.

```&FormattedVar = = '<div style="font-family: "Calibri Light", Calibri;  text-align:center;" >' + &VarPart1+ '<b>' + &VarPart2+ '</b>' + &VarPart3+ '</div>'```

【问题讨论】:

【参考方案1】:

尝试将以下部分修改为如下所示:

[Embeed Fonts]
Arial Narrow= true
Tahoma= true
3 of 9 Barcode= true
BarCode 128= true
Bahnschrift SemiCondensed= true
Bahnschrift Condensed= true
Bahnschrift= true
Calibri Light= true
Arial Black= true

如果您使用的是 C# 生成器,您也可以尝试使用 DEBUG=true 并将属性 Log Level 更改为 6.ALL,然后再次执行并尝试在 client.log 文件中查找任何错误。

一些参考资料:

https://www.genexus.com/en/developers/websac?data=16412 https://wiki.genexus.com/commwiki/servlet/wiki?27500,PDFReport.ini%20file%20format

【讨论】:

以上是关于Genexus - PDF 报告(Web)中不显示字体的主要内容,如果未能解决你的问题,请参考以下文章

如何修复 Genexus 中的 Android 编译错误?

Libre Office 标签在 iTextSharp 中不显示为“AcroFields”?

如何将报告导出为 PDF/A-1a、PDF/A-1b?

如何在 pdf 中不显示页码 = 1? (HTML CSS)

Javascript函数显示带有setTimeout的隐藏按钮在PDF中不起作用

在 BIRT 报告中定义书签,以便在 pdf 输出中显示