QuestPDF is a modern open-source .NET library for PDF document generation. Offering comprehensive layout engine powered by concise and discoverable C# Fluent API. Easily generate PDF reports, invoices, exports, etc.
Describe the bug
FontManager.RegisterFontFromEmbeddedResource doesn't load the supplied resource for resources in projects other than the QuestPDF assembly itself.
Instead an exception is thrown.
To Reproduce
Call FontManager.RegisterFontFromEmbeddedResource from a custom project with the resource name of an embedded resource font in that custom project
Expected behavior
The embedded resource font from the custom project is registered in the FontManager.
Screenshots
Additional context
FontManager.RegisterFontFromEmbeddedResource calls Assembly.GetExecutingAssembly().
This will return the QuestPDF assembly itself instead of the calling assembly, which of course doesn't find the supplied resource in its resource manifest.
I think this can be fixed by calling Assembly.GetCallingAssembly instead.
Describe the bug FontManager.RegisterFontFromEmbeddedResource doesn't load the supplied resource for resources in projects other than the QuestPDF assembly itself. Instead an exception is thrown.
To Reproduce Call FontManager.RegisterFontFromEmbeddedResource from a custom project with the resource name of an embedded resource font in that custom project
Expected behavior The embedded resource font from the custom project is registered in the FontManager.
Screenshots
Additional context FontManager.RegisterFontFromEmbeddedResource calls Assembly.GetExecutingAssembly(). This will return the QuestPDF assembly itself instead of the calling assembly, which of course doesn't find the supplied resource in its resource manifest. I think this can be fixed by calling Assembly.GetCallingAssembly instead.