Closed LaurelJay closed 3 years ago
I'm not sure what you mean by not working in Excel. Please send a reproducible if its not working. But I'm quite sure it should be working fine.
I'm assuming you are using Java and having problems with Java image API. In which case you can use ImageInfo class from Templater directly and specify expected parameters there.
I'm using C# , and my model has [DataMember] public virtual byte[] LogoReport { get { return _logoReport; } set { SetProperty(ref _logoReport, value, "LogoReport"); } }
[DataMember]
public virtual Image LogoReportImg
{
get
{
if (LogoReport == null)
{
return null;
}
else
{
using (var ms = new MemoryStream(LogoReport))
{
return Image.FromStream(ms);
}
}
}
}
Then we are binding using [[comp.LogoReportImg]:maxSize(15, 20)] , The image is displaying but the maxSize has no effect. The provided example is on Microsoft Word, and I try it using Microsoft Excel.
Its hard to know why without you providing example which we can run. If I had to guess, I would say you didn't register the plugin during initialization: https://github.com/ngs-doo/TemplaterExamples/blob/master/Intermediate/Pictures/src/Program.cs#L118
Ok, I did'nt know I have to add that Plug-in thanks..
Image MaxSize is not working on Excel document. How can we maintain Aspect ratio?