reportviewercore icon indicating copy to clipboard operation
reportviewercore copied to clipboard

fix drawing image in rendering excel/word report in linux

Open zatkhahi opened this issue 2 years ago • 7 comments

I fix an issue in rendering rdlc containing image in linux systems.

zatkhahi avatar Jul 09 '23 05:07 zatkhahi

ImageSharp has a license incompatible with Report Viewer - I can't add this dependency.

lkosson avatar Jul 10 '23 04:07 lkosson

Hi @lkosson

I want to use your library in Linux/Docker, but I understand your concern about merging this PR.

Can we modify this library to make the renderer part configurable so the user can image ImageSharp or whatever?

OR can we use Aspose.Drawing instead?

amir734jj avatar Nov 08 '24 06:11 amir734jj

As far as I'm concerned, you can fork and modify this library as you wish. Just keep in mind that original Report Viewer (on which this project is based) is still owned and licensed by Microsoft.

lkosson avatar Nov 08 '24 06:11 lkosson

@lkosson that is fine, but still it would be great for this library to handle Linux rendering well. Maybe using SkiaSharp would be good enough as it is MIT license?

vasicvuk avatar Mar 06 '25 11:03 vasicvuk

For this particular case, I guess the best resolution would be to just parse jpg/png/gif/bmp header to extract image width and height directly from bytestream. Shouldn't be more than 100 LoC extra and wouldn't need to pull whole image processing library along with it's native components just to read basic metadata.

lkosson avatar Mar 06 '25 11:03 lkosson

@lkosson You are right for this case, but i would expect to change whole System.Drawing with SkiaSharp in order to have full Linux compatibility.

vasicvuk avatar Mar 06 '25 11:03 vasicvuk

.docx renderer don't seem to use System.Drawing for anything else than determining image dimensions. Full Linux compatibility for other renderers (including PDF) is hopeless. Text layout is done using UniScribe, which has no open/free/cross-platform equivalents. Also various parts of renderers depend on GDI, with all its quirks and bugs.

The only way I can think of is to completely rewrite a renderer to output PDF using SkiaSharp. I estimate it would take a good half of the year to get some output and another half to make it look at least similar to current PDF renderer. While that sounds like a lot of fun, I can't afford to focus full-time only on this project.

lkosson avatar Mar 06 '25 16:03 lkosson