I'm working on a UWP app and as one of the requirements I need to generate a PDF file dynamically.
There are a few contraints / requirements that I need to concider:
- Need an ability to generate PDF from the UWP app directly / offline scenario
- Potentially need an ability to generate the report on the server - ideally from the same source template
- Report needs to be somewhat dynamic (i.e. not compiled into the app it self and format editable without recompilation of the app)
- Ideally - not depend on a closed source propetiary library / component
I have had couple of ideas on how to approach this:
- Have a XAML page and convert it PDF by printing that XAML view as a PDF through a hidden print dialog - limited by the fact the XAML will need to be compiled into the app + would probably be imposisble to use the same approach to generate reports on the server side.
- Do something similar with an WebView and HTML - but that will require JavaScript logic to be executed - adn I'm not sure if it is possible in UWP app.
Has anyone achieved something similar in the past and if so - what approach have you taken?