maltreport icon indicating copy to clipboard operation
maltreport copied to clipboard

Image Render

Open azacchino opened this issue 7 years ago • 3 comments
trafficstars

Hello, I tried to create a document (odt) with an embedded image. In the image, just replace the name with "$var". When you try to replace it with the context, the file is broken. How do I associate the image I want to replace with the context?

Using NuGet Version ( 2.1.1 )


System.IO.MemoryStream ms = new MemoryStream();
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
ms.GetBuffer();
Image im = new Image("png", ms.GetBuffer());

var renderContext = new Dictionary<string, object>()
{
       { "var", im },
}

OdfTemplate a = new OdfTemplate();
a.Load(path);
a.Compile();
IDocument b = a.Render(renderContext);
b.Save(@"C:\temp\simpleImageMap.ods");

Regargs

azacchino avatar Jan 31 '18 15:01 azacchino

Hello:

Sorry for the late response. Image rendering with MaltReport 2.1.1 has some serious issues, please try 3.x preview, it's stable enough to works with ODT/ODS.

MaltReport 3.x supports .NET FX 4.6 and .NET Core both.

Please see the HelloWorld project as an image-rendering sample in in the source repository.

oldrev avatar Feb 02 '18 05:02 oldrev

Hi! Thanks for the response. The 3.x branch hasn't tag. ¿the master branch is the 3.x?

azacchino avatar Feb 02 '18 12:02 azacchino

Yes, the master branch is 3.x, or you can install lib from nuget: https://www.nuget.org/packages/MaltReport2/3.0.0-beta-7

oldrev avatar Feb 02 '18 14:02 oldrev