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 font to PDF #474

Merged
merged 5 commits into from
Feb 1, 2022
Merged

Add font to PDF #474

merged 5 commits into from
Feb 1, 2022

Conversation

maxammann
Copy link
Member

fixes #354

@@ -65,6 +65,12 @@ export function generatePdf(models: CardActivateModel[], region: Region) {
unit: 'mm',
format: 'a4'
});

let response = uint8ArrayToBase64(new Uint8Array(await (await fetch("/pdf-fonts/NotoSans-Regular.ttf")).arrayBuffer()));
Copy link
Member Author

Choose a reason for hiding this comment

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

Error handling is missing here

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let response = uint8ArrayToBase64(new Uint8Array(await (await fetch("/pdf-fonts/NotoSans-Regular.ttf")).arrayBuffer()));
const response = uint8ArrayToBase64(new Uint8Array(await (await fetch("/pdf-fonts/NotoSans-Regular.ttf")).arrayBuffer()));

Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Not tested as I have never worked with the administration yet

docker/reverse_proxy/nginx-staging.conf Show resolved Hide resolved
@@ -65,6 +65,12 @@ export function generatePdf(models: CardActivateModel[], region: Region) {
unit: 'mm',
format: 'a4'
});

let response = uint8ArrayToBase64(new Uint8Array(await (await fetch("/pdf-fonts/NotoSans-Regular.ttf")).arrayBuffer()));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let response = uint8ArrayToBase64(new Uint8Array(await (await fetch("/pdf-fonts/NotoSans-Regular.ttf")).arrayBuffer()));
const response = uint8ArrayToBase64(new Uint8Array(await (await fetch("/pdf-fonts/NotoSans-Regular.ttf")).arrayBuffer()));

Copy link
Member

@michael-markl michael-markl left a comment

Choose a reason for hiding this comment

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

Also not tested

docker/reverse_proxy/nginx-staging.conf Show resolved Hide resolved
docker/reverse_proxy/nginx-staging.conf Show resolved Hide resolved
@maxammann maxammann enabled auto-merge February 1, 2022 17:21
@maxammann maxammann merged commit 4990cde into main Feb 1, 2022
@maxammann maxammann deleted the 354-add-font-pdf branch February 1, 2022 17:32
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.

jsPDF does not support utf8 out of the box
3 participants