fix(pdf): pdf quality and multiline #204

Merged
enes merged 2 commits from 176-178-pdf-quality-multiline into staging 2024-09-17 13:59:17 +00:00
Member

This PR solves two issues #176 and #178 with the usage of pdf-lib's drawText method.

The method embeds the text into the pdf itself (no loss of quality was observed) and handles multiline text out of the box.

Small adjustments were made to the text positioning logic:

  • The text origin is set to the top left point of the mark location.
  • New placeholder (toolbox label) that allows us to easily place text exactly where we want it.
  • To help with positioning mark border is replaced with the outline (outline takes "no space") which makes positioning text easier

Additional changes:

  • Mark font replaced from Arial to Roboto (custom font is embedded with @pdf-lib/fontkit into the pdf itself as ttf with increased character support, existing woff2 and woff were lacking some characters after embedding)
This PR solves two issues #176 and #178 with the usage of pdf-lib's `drawText` method. The method embeds the text into the pdf itself (no loss of quality was observed) and handles multiline text out of the box. Small adjustments were made to the text positioning logic: - The text origin is set to the `top` `left` point of the mark location. - New placeholder (toolbox `label`) that allows us to easily place text exactly where we want it. - To help with positioning mark border is replaced with the outline (outline takes "no space") which makes positioning text easier Additional changes: - Mark font replaced from `Arial` to `Roboto` (custom font is embedded with `@pdf-lib/fontkit` into the pdf itself as `ttf` with increased character support, existing `woff2` and `woff` were lacking some characters after embedding)
enes added 2 commits 2024-09-17 12:54:13 +00:00
Closes  #176, #178
fix(pdf): keep upscaling to match viewport
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 34s
43beac48e8
enes requested review from eugene 2024-09-17 12:54:43 +00:00
eugene approved these changes 2024-09-17 13:04:45 +00:00
eugene left a comment
Owner

Looks good!

Looks good!
enes merged commit c52fecdf4e into staging 2024-09-17 13:59:17 +00:00
enes deleted branch 176-178-pdf-quality-multiline 2024-09-17 13:59:17 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sigit/sigit.io#204
No description provided.