Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

PdfFormatProvider using PdfInlineUIContainersExportMode.Image doesn't render the correct size

$
0
0
Hello Robert,

The export to PDF logic of InlineUIContainers is pretty straight-forward - a snapshot of the container is made and the bitmap is added to the exported document. That said, this most likely comes down to taking the image at the proper time. 

Could you confirm the document containing the UI container is in the visual tree at the time of the export? This should ensure the chart is properly measured and arranged, so taking a picture of it would work fine. Additionally, could you share the OS you are trying this with? 

I will greatly appreciate if you can send over some snapshots if the result and if possible, a sample application demonstrating the problem. What I tried locally is to insert an InlineUIContainer in a RadRichTextBox with this code:
RadCartesianChart chart = new RadCartesianChart() { Width = 480, Height = 270 };
CategoricalAxis catAxis = new CategoricalAxis();
LinearAxis lineAxis = new LinearAxis();
chart.HorizontalAxis = catAxis;
chart.VerticalAxis = lineAxis;
 
BarSeries barSeries = new BarSeries();
barSeries.DataPoints.Add(new CategoricalDataPoint() { Category = "Apples", Value = 20 });
barSeries.DataPoints.Add(new CategoricalDataPoint() { Category = "Bananas", Value = 28 });
barSeries.DataPoints.Add(new CategoricalDataPoint() { Category = "Oranges", Value = 17 });
barSeries.DataPoints.Add(new CategoricalDataPoint() { Category = "Strawberries", Value = 30 });
chart.Series.Add(barSeries);
 
var uiContainer = new InlineUIContainer(chart, new Size(480, 270));
this.radRichTextBox.InsertInline(uiContainer);

And then export it to PDF with the method you sent us. This, however, works perfectly on my end, so maybe I'm missing something important in your setup.

Regards,
Petya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>