这是indexloc提供的服务,不要输入任何密码
Skip to content

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
Contributor

@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