Following the examples in the docs, I can add a graphic to a PDF that I'm creating by setting the "FileName" attribute to a jpg on disk:
Code: Select all
oPicture.Attribute("FileName").Value = @"c:\temp\test2.jpg";
However, when I use the "BitmapData" attribute, and set it to a byte array, it always fails when I save the page. I've tried several image formats, with the same results.
Code: Select all
using (MemoryStream msPic = new MemoryStream())
{
m_img.Save(msPic, System.Drawing.Imaging.ImageFormat.Jpeg);
oPicture.Attribute("BitmapData").Value = msPic.ToArray(); // GetBuffer() gives the same results
msPic.Close();
}
Error: "Attempted to divide by zero" in Amyuni.PDFCreator.IacDocument.SavePageNumber.
I'm using PDF Creator v3.0.
Thanks,
Nathan