Generate PDF containing Charts

Charts for WPF Forum

Posted 10 months ago by Jerin Sebastian
Version: 18.1.0673
Avatar

How do I generate a PDF, which contains Actipro Charts. Is it possible to do it in Windows Service rather than WPF?

Comments (3)

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I don't believe WPF has any facilities built-in to do PDF creation.  I have seen articles like this one where you can create a WPF FixedDocument and then try to export it to PDF:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/e8dbc5d6-f4e2-4aec-9801-8d92b8181351/wpf-how-to-export-wpf-controlpage-to-pdf-file?forum=wpf

You can generally put any UI elements in a FixedDocument.


Actipro Software Support

Posted 10 months ago by Jerin Sebastian
Avatar

I had implemented it in WPF and it worked. But when I implemented it in Windows Service to generate PDF, the charts were not getting rendered.

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jerin,

It's hard to say but maybe the default Styles for the WPF controls don't get applied if you don't run it from a WPF app?  We've seen this sometimes when customers use WPF Controls inside of a WinForms application.  In that case, you need to create an instance of a WPF Application() object before referencing any UI controls if one doesn't already exist.  I believe that gets things registered so styles will get applied.  Maybe that will do the trick for your scenario.


Actipro Software Support

The latest build of this product (v2019.1 build 0682) was released 30 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.