EvoPdf: 使用baseUrl处理外部资源时,将HTML转换为图像时出现问题。

huangapple go评论98阅读模式
英文:

EvoPdf: Problem on converting html to image while using baseUrl for external resources

问题

I'm using EvoPdf for converting HTML to an Image (EvoPdf: ConvertHtmlToImageObject). Now I tried to set the baseUrl for using local resources like: in the html I'm using a css link for custom fonts.

imgConverter.ConvertHtmlToImageObject(html, baseUrl: path)
-> the folder contains the css with the @font-faces and the custom font ttf's and woff's.

But somehow it doesn't work. It's like it doesn't even read the baseUrl.
I was trying to use different baseUrl's, I placed my resources in all different folders of the project but still nothing worked.

Does someone have an idea what I could be doing wrong?
Or even better a working example?

Thanks guys!

英文:

I'm using EvoPdf for converting HTML to an Image (EvoPdf: ConvertHtmlToImageObject). Now I tried to set the baseUrl for using local resources like: in the html I'm using a css link for custom fonts.

imgConverter.ConvertHtmlToImageObject(html, baseUrl: path)
-> the folder contains the css with the @font-faces and the custom font tff's and woff's.

But somehow the it doesn't work. It's like it doesn't even read the baseUrl.
I was trying to use differen baseUrl's, I placed my resources in all different folders of the project but still nothing worked.

Does someone have an idea what I could be doing wrong?
Or even better a working example?

Thanks guys!

答案1

得分: 0

谢谢各位!
我认为我找到了问题所在。我尝试连接到本地驱动器,而不是使用网站资源。
BaseUrl应该是我的网站的URL。

英文:

Thanks guys!
I think I found the issue. I tried to connect to a local drive instead of using the website resources.
The BaseUrl is supposed to be the URL of my website.

huangapple
  • 本文由 发表于 2023年6月9日 07:01:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76436209.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定