PDFsharp generates blank page in Azure, but works locally

匆匆过客 提交于 2019-12-01 20:37:45

It's likely a font problem if a complete PDF arrives at the client (I asked for conformation in a comment but got no answer yet).

PDFsharp must have access to the TTF files to extract information. Are the fonts you use in the %windir%\fonts folder and does your process have privileges to read them?

Azure is a candidate for IFontResolver because many fonts are missing and privileges are usually not granted.

With IFontResolver you give PDFsharp direct access to the TTF files (as byte[]).

You can use my class EZFontResolver for that purpose:
http://developer.th-soft.com/developer/2015/12/11/ezfontresolver-a-generic-font-resolver-for-pdfsharp-and-migradoc/

I also have a sample that shows how to implement your own IFontResolver:
http://developer.th-soft.com/developer/2015/09/21/using-private-fonts-with-pdfsharp-1-50-beta-2-or-migradoc/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!