This commit is contained in:
2020-09-10 16:24:07 +00:00
parent d8ba7959d9
commit 30743d7b85
3 changed files with 114 additions and 7 deletions

View File

@@ -23,4 +23,105 @@ REQUIREMENTS
- When report is run it will have all fields this way returned but will still be sorted and filtered by table view
- As part of editing process user can select an existing datalistview to prime their report editing view
- A report can be selected from any client table that is based on the same view
//=======================
USEFUL REPORTING RELATED LINKS
https://github.com/jsreport/jsreport-core
https://github.com/jsreport/jsreport-core/blob/master/lib/render/engineScript.js
//actual render here
https://github.com/jsreport/jsreport-chrome-pdf/blob/d3fe318aac3628d8cb62f86f8f71314f21745798/lib/conversion.js
This is the jsreport designer libs used for reference: https://github.com/jsreport/jsreport-studio/blob/master/package.json
https://jsreport.net/learn/api
Report templates pre-designed and open source: https://github.com/wildbit/postmark-templates
HTML -> PDF
JSREPORT has a comparison table of various html to pdf tools here:
https://jsreport.net/learn/pdf-recipes
Headless Chrome
https://github.com/jsreport/jsreport-chrome-pdf
FAST SPEED (according to jsreport docs)
jsreport uses headless chrome by default which has built in pdf from html ability.
they use a NODE library Puppeteer for it, but there is a c# wrapper for .net core linux windows mac: https://github.com/hardkoded/puppeteer-sharp
some kind of example that may be relevant: https://github.com/kblok/netconfar-puppeteer-sharp-demo/blob/master/hacking-the-browser-api/Controllers/MediumController.cs#L13
Maybe not the only one for c# core, need to dig around
Issues:
Issue with header / footer not being settable apparently which is a big breaking issue for many biz reports usage
someone said that another pdf tool can be used to set those post processing but fuckery abounds
other solutions below apparently don't have this issue.
Even jsreport has listed workarounds and tools to resolve this
Update: apparently there are ways:
https://stackoverflow.com/questions/44575628/alter-the-default-header-footer-when-printing-to-pdf?noredirect=1&lq=1
see last comment seems relevant, also other linked cases all mention various things. Finally, could use a pdf writer tool to post process maybe.
There seem to be many potential issues with missing libraries, rights and sandbox and etc etc etc on linux
These things kind of turned me off this a bit, it's not plug and play and simple
LINKS:
https://github.com/hardkoded/puppeteer-sharp
https://github.com/puppeteer/puppeteer
https://stackoverflow.com/search?q=puppeteer-sharp
https://stackoverflow.com/questions/62042078/puppeteer-sharp-for-server-side-html-to-pdf-conversions
https://www.singlestoneconsulting.com/blog/how-to-generate-server-side-pdf-reports-puppeteer-d3-handlebars/
https://github.com/hardkoded/puppeteer-sharp/issues/1510 - shows being used by someone other than jsreport which buries all the details in endless libs
https://github.com/hardkoded/puppeteer-sharp/issues/1514
WeasyPrint
https://github.com/jsreport/jsreport-weasyprint-pdf
SLOWEST SPEED
https://github.com/Kozea/WeasyPrint based on python, does it's own rendering doesn't rely on a web browser engine like the rest
free, recommended by wkhtmltopdf author as an alternative
May be slow, slower than the other options likely, has some installation steps that are a bit convoluted but ironically only for windows as it's included in package managers
Very good support for modern css3 PAGE properties apparently
WRAPPER
https://github.com/balbarak/WeasyPrint-netcore/blob/master/src/Balbarak.WeasyPrint/WeasyPrintClient.cs
wkhtmltopdf
https://github.com/jsreport/jsreport-wkhtmltopdf
MEDIUM SPEED
https://wkhtmltopdf.org/downloads.html
Well used, old based on older webkit so doesn't support css3 but likely enough for our purposes
has an easy installer for all platforms
free
Has warnings about how unsanitized html can take down a server or own it somehow
WRAPPERS
https://github.com/carloscds/HtmlToPDFCore/tree/master/HtmlToPDFCore This one looks cool, all platforms supported includes binary possibly?
https://blog.elmah.io/generate-a-pdf-from-asp-net-core-for-free/
HTML -> DOCX
This is a possiblity that needs to be researched, instead of pdf go docx which is in theory multi platform and openable on other devices? Not sure
https://github.com/jsreport/jsreport-docx
https://github.com/EricWhiteDev/Open-Xml-PowerTools
HTML -> XLSX
https://github.com/jsreport/jsreport-xlsx
HTML -> TEXT
https://github.com/jsreport/jsreport-html-to-text
https://github.com/jsreport/jsreport-text
TEMPLATE ENGINE
https://github.com/jsreport/jsreport-handlebars
Handlebars by default for jsreport which is easy peasy to work with
PDF META DATA EDITING
https://github.com/jsreport/jsreport-pdf-meta
Render outputs
JSReport renders to different outputs, they call it recipes https://jsreport.net/learn/recipes
HTML - just outputs as html for viewing in the browser / printing from browser
PDF: https://jsreport.net/learn/pdf-recipes
Outputs 5 different pdf converters because they all support different feature sets which is ominous