Export Chart to PDF without rendering

Hello 

I have a a TabControleExt with a few TabItems and in each of these items is a SfChart. I want to export these Charts as Streams without necessarily viewing them. When I do this I get this error when trying to Save the chart to a Stream. 

The parameter value must be greater than zero. (Parameter 'pixelWidth')

I have set the Measure and Arrange manually like so:


chart.Background = new SolidColorBrush(Colors.White);

chart.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));

chart.Arrange(new Rect(new Size(700, 500)));


But even this did not fix the problem.. When I set the height and width manually it works but I don't want to set it to a fixed value. How can I fix this. 



2 Replies

GM Gayathri Manickam Syncfusion Team November 11, 2021 02:07 AM UTC

Hi Gerrit, 
 
Greetings from Syncfusion.    
    
This is a general update to let you know that our support team has taken out your query and we are validating the feasibility to achieve your requirement. We will update you the complete status on 12th November 2021.   
   
Regards,   
Gayathri M 



GM Gayathri Manickam Syncfusion Team November 30, 2021 04:42 PM UTC

Hi Gerrit, 
 
Sorry for the delay.  
 
We analyzed your query, and we would like to let you know that “The parameter value must be greater than zero. (Parameter 'pixelWidth')” exception may occur when trying to save the chart even it is not in UI. If it so, we need to call Measure() and arrange() methods of chart manually before saving it. Please refer below sample, 
 
 
Please let us know if you need any further assistance on this.  
 
Thanks,  
Gayathri M. 


Loader.
Up arrow icon