Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PDF reports #319

Merged

Conversation

ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Feb 16, 2024

This PR adds support for PDF reports


Basic changes:


How PDF generation works

For PDF generation uses browser emulation with printing HTML to PDF format:

Feature has the following flow:

  • PUG templates which provide flexibility with inheritance and mixins
  • render PUG template to HTML + inline CSS + inline fonts in base64 to have everything in one HTML string
  • as IPC sends data between the main and child processes synchronously it works following:
    • in the framework writes HTML into temporary file asynchronously
    • send message via IPC with HTML file path to electron handler
    • under electron, reads HTML file (if ok removes temp file) and prints to PDF asynchronously
    • then writes PDF into temporary file asynchronously
    • send an answer message via IPC with PDF file path to the framework handler
    • if the framework can read the file it removes the temp file

Depends on these PRs:

Copy link
Collaborator

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@ezewer ezewer merged commit 967e074 into bitfinexcom:staging Feb 20, 2024
@ZIMkaRU ZIMkaRU deleted the feature/add-support-for-pdf-reports branch March 13, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants