Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Render #18

Open
azacchino opened this issue Jan 31, 2018 · 3 comments
Open

Image Render #18

azacchino opened this issue Jan 31, 2018 · 3 comments

Comments

@azacchino
Copy link

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

@oldrev
Copy link
Owner

oldrev commented Feb 2, 2018

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.

@azacchino
Copy link
Author

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

@oldrev
Copy link
Owner

oldrev commented Feb 2, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants