i'v saved the current grid as a image to disk. and also now exporting the image to the pdf.
everything in the exporting is going on very well.
bt issue arises when.. the image wat I've exported to the pdf, the background is black which is overridden with black background when i open pdf.
I'm using the telerik raddocument ....
Image is saved to disk as BMP format, which is having proper black background.
can anyone please help me out for this.
private void PrepareDocument(RadDocument document)
{
document.SectionDefaultPageOrientation = PageOrientation.Landscape;
document.LayoutMode = DocumentLayoutMode.Flow;
document.Measure(RadDocument.MAX_DOCUMENT_SIZE);
document.Arrange(new Telerik.Windows.Documents.Model.RectangleF(new Telerik.Windows.Documents.Model.PointF(10,10), document.DesiredSize));
}
private void CreateChartDocumentPart(RadDocument document, Grid whGrid, Grid companysnapshot, Grid chartgridimage)
{
Telerik.Windows.Documents.Model.Section section1 = new Telerik.Windows.Documents.Model.Section();
Telerik.Windows.Documents.Model.Section section2 = new Telerik.Windows.Documents.Model.Section();
Telerik.Windows.Documents.Model.Section section3 = new Telerik.Windows.Documents.Model.Section();
Telerik.Windows.Documents.Model.Paragraph paragraph1 = new Telerik.Windows.Documents.Model.Paragraph();
Telerik.Windows.Documents.Model.Paragraph paragraph2 = new Telerik.Windows.Documents.Model.Paragraph();
Telerik.Windows.Documents.Model.Paragraph paragraph3 = new Telerik.Windows.Documents.Model.Paragraph();
Telerik.Windows.Documents.Model.Span span1;
Telerik.Windows.Documents.Model.Span span2;
Telerik.Windows.Documents.Model.Span span3;
using (MemoryStream ms = new MemoryStream())
{
paragraph1.LeftIndent = 30;
paragraph1.RightIndent = 30.0;
FileStream filestrmtest = File.Open(@"C:\Users\Admin\Desktop\logoall.bmp", FileMode.Open);
ImageInline image1 = new ImageInline(filestrmtest, new System.Windows.Size(1100, (int)Math.Round(whGrid.ActualHeight)+20), "bmp");
paragraph1.FlowDirection = FlowDirection.LeftToRight;
paragraph1.Inlines.Add(image1);
paragraph2.LeftIndent = 30;
paragraph2.RightIndent = 30.0;
filestrmtest = File.Open(@"C:\Users\Admin\Desktop\companyss.bmp", FileMode.Open);
companysnapshot.Background = new ImageBrush(image1.ImageSource);
ImageInline image2 = new ImageInline(filestrmtest, new System.Windows.Size(900, (int)Math.Round(companysnapshot.ActualHeight)), "bmp");
paragraph2.FlowDirection = FlowDirection.LeftToRight;
paragraph2.Inlines.Add(image2);
filestrmtest.Close();
span1.
}
try
{
section1.Blocks.Add(paragraph1);
document.Sections.Add(section1);
section2.Blocks.Add(paragraph2);
document.Sections.Add(section2);
}
catch (Exception)
{
}
}