VahidN/PdfReport.Core

How to show images not from local path

Closed this issue · 3 comments

Hi. Thank you for this amazing library. In my case, images are returned from the db, they are presented in a List-box on the UI, so to keep my life simpler, I have two properties: one is byte[] and the other one is ImageSource (this is what WPF uses to display the actual image). Now when the actual PDF needs to be generated, I don't keep any of the images locally on the hard drive. I just keep them inside ObservableCollection used for binding. Is there a way to just convert images from byte[] without providing actual path ? Thanks

Hi, You can use ByteArrayImage for it

column.ColumnItemsTemplate(t => t.ByteArrayImage(defaultImageFilePath: string.Empty, fitImages: false));

Thanks, it works.

Is there any event that is raised when the PDF document is created ?

Yes. If you want to add some more info add the end of the main table, use events.MainTableAdded.