DinkToPdf
DinkToPdf copied to clipboard
Convert a byte array
Could the following be added/changed in DinkToPdf.ObjectSettings? Property RawContent in order to feed the converter also with a byte array instead of a string. In my scenario the input is already a byte array with utf-8 encoding.
I've added that to my custom build of DinkToPdf. See https://github.com/Casimodo72/Casimodo.Lib/blob/master/src/Casimodo.Lib.Web.Pdf.AppService/Controllers/PdfController.cs But it would be nice to have that officially in the sources so that I can use DinkToPdf's NuGet package instead of my custom build.
public byte[] RawContent { get; set; }
public byte[] GetContent()
{
if (RawContent != null)
return RawContent;
if (HtmlContent == null)
{
return new byte[0];
}
return Encoding.UTF8.GetBytes(HtmlContent);
}