How can one export a LWC as a PDF?
(Same as this post, with a slightly different angle)
A couple hours of research have not yielded any useful results
Requirement: Create a way to export the LWC so it can easily be shared outside of SF. A pdf would be ideal but it doesn't have to be, as long as it can be exported with just a few clicks and it maintains the formatting of the LWC (see sample image below).
The LWC may have any amount of Grant and/or Line Item records, so it could be half a page or 10 pages long. And to clarify, I do not mean create a PDF from the LWC, I mean create a PDF of the LWC itself. I have a LWC that creates a table with specific formatting that I need to export (pdf would be ideal, but not strictly necessary). It will be shared with higher ups and deals with budgets so it needs to be crisp and maintain the formatting of the LWC. I was considering/exploring:
- Placing the LWC in a Visualforce (VF) page and render VF page as pdf (VF can't render as pdf JavaScript rendered content, such as a LWC)
- Standard page print functionality (not ideal: omits colors, breaks table, includes link URLs)
- Recreate the LWC table in report and export from there (intended formatting is lost, it would require recreating the formatting in excel sheet or something like that)
- Custom app from AppExchange (none found that would fulfill this need)
- Basic screenshot of the LWC (loses image quality, text not selectable, not scalable for when LWC has many rows)
If you have run into this before, found a solution, and could point me in the right direction, I would really appreciate it!