danfickle / danfickle/openhtmltopdf-native

Unable to make custom fonts to work

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I was able to run this as a servless lambda function on AWS using quarkus native build. It is working great but the only issue I was unable to work it out is the fact that even though the font file is loaded properly it is not rendering on the PDF. This issue only occurs with the native build.

I use the following code to load the files from the resource and it does not throw any message.

```
builder.useUriResolver((baseUri, uri) -> {
if (baseUri != null) {
URL resource = RelatorioHandler.class.getClassLoader().getResource(uri);
if (resource == null)
throw new RuntimeException("Resource não encontrado");

return resource.toString();
}

return uri;
});
```

[expected.pdf](https://github.com/danfickle/openhtmltopdf-native/files/7429973/expected.pdf)
[actual.pdf](https://github.com/danfickle/openhtmltopdf-native/files/7429974/actual.pdf)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.