Hello, I am using Aspose.PDF version 22.7 to convert Html to PDF inside an azure function V2 linux platform, locally it works fine, but I have the same problem who reported it initially, it is throwing the exception "System.Drawing is not supported on this platform ", I pass the html as it is since it has images and text and I resize the sheet so that it has the expected format, what should I do to solve the problem? Example code:
MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(HTML));
HtmlLoadOptions loadoptions = new HtmlLoadOptions();
loadoptions.PageInfo.Margin = new MarginInfo(0, 0, 0, 0);
loadoptions.PageInfo.Height = Aspose.Pdf.PageSize.PageLetter.Height;
loadoptions.PageInfo.Width = Aspose.Pdf.PageSize.PageLetter.Width;
Document doc = new Document(ms, loadoptions);
Byte[] B64pdf = null;
MemoryStream pdf = new MemoryStream();
foreach (var page in doc.Pages)
{
Rectangle r = page.MediaBox;
double newHeight = 450;
double newWidth = 610;
double newLLX = r.LLX;
double newLLY = r.LLY + (r.Height - newHeight);
page.MediaBox = new Rectangle(newLLX, newLLY, newLLX + newWidth, newLLY + newHeight);
page.CropBox = new Rectangle(newLLX, newLLY, newLLX + newWidth, newLLY + newHeight);
}
doc.Save(pdf);
B64pdf = pdf.ToArray();
I hope you can help me, thanks for your time