Hi
I have a problem with Aspose.PDF and Aspose.Chart working together: the image on the PDF is very poor in quality and the print of the PDF is not acceptable. I m developing Financial documents where the quality takes the first place.
Here is the C# code to create the images including them into the pdf:
Chart:
Chart c = new Chart();
... Chart configurations....
c.Height = 450F;
c.Width = 800F;
... Chart data retrieving ...
// Finally chart saving
MemoryStream ms = new MemoryStream();
c.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
PDF:
Pdf _pdf = new Pdf();
... Bind pdf to XML template having the section
sec1 = _pdf.Sections[0];
Aspose.Pdf.Image image = new Aspose.Pdf.Image(sec1);
//==================================================================================================================
// GET Image From MEMORY Stream
//Create a BinaryReader object to read bytes from MemoryStream for IMAGES
System.IO.BinaryReader reader = new System.IO.BinaryReader(ms);
//Set the file and open types of the image
image.ImageInfo.ImageFileType = ImageFileType.MemoryBmp;
image.ImageInfo.OpenType = ImageOpenType.Memory;
image.ImageWidth=800F;
image.ImageHeight=450F;
image.Margin.Left=5;
image.Margin.Top=20;
//Set position
ms.Position = 0;
//Read bytes from the MemoryStream and store as memory data for the image to
//be added to Pdf document
image.ImageInfo.MemoryData = reader.ReadBytes((int)ms.Length);
reader.Close();
sec1.Paragraphs.Add(image);
_pdf.Save(_PDFPath);
I tried many of the examples you posted in the forums and in the guideline without results: more of them have the method Save of the Chart to a bitmap (i.e. Bitmap bm = new Bitmap(); bm= chart.Save()) that is no more supported by the last versions.
The section has an header and a footer and is landscape A4 or Letter; the image should occupy the entire page
Please give me a solution since I have to deliver the documents by the end of this month January 2006.
Note that we have bought the Aspose.Total license.
Thanks
vmax