carloscds / HtmlToPDFCore

Convert HTML to PDF
MIT License
51 stars 25 forks source link

Resource links #3

Closed Avallex closed 2 years ago

Avallex commented 3 years ago

Hi,

Had a quick play around, seems conversion of relative reference URLs to absolute references isn't supported by the converter.

I.e.: "../img/jjw_logo_transparent.png" or for sake of Mvc "~/img/jjw_logo_transparent.png"

If this is doable and could be added it would be a massive, massive help.

Thanks!

Avallex commented 3 years ago

If anybody is using .NET Core Mvc then using a simple regular expression you can replace the relative references that way:

image

carloscds commented 3 years ago

Hi @Avallex , This tool do not look for HTML content, only convert HTML to PDF, maybe you can do this before call converter.

Avallex commented 3 years ago

That's okay, I've done that with regex, thanks for the quick reply!