wkhtmltopdf amazon linux won't encode emoji
I'm trying to generate a PDF via wkhtmltopdf
in an Amazon Linux
os, everything works fine, but when i try to use emoji on the HTML
, the fonts break and the emoji is displayed as a black box.
Before deploying, i tried locally and it works, locally i have Ubuntu
, so my guess is that i'm missing something (fonts?) in the production (the amazon linux instance) server. I tried to install Google Noto
font but nothing happened. I'll attach 2 screens of the same HTML
page, generated by the same command via wkhtmltopdf
:
Local (Ubuntu):
Production (Amazon Linux):
As you can see, even the font below the broken emoji is not rendered as aspected, i'll add the command i use in both servers:
/my/path/to/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality 'file:///my/path/to/page-test-pdf.html' '/home/user/test.pdf'
Thanks for your time.
encoding wkhtmltopdf emoji amazon-linux
add a comment |
I'm trying to generate a PDF via wkhtmltopdf
in an Amazon Linux
os, everything works fine, but when i try to use emoji on the HTML
, the fonts break and the emoji is displayed as a black box.
Before deploying, i tried locally and it works, locally i have Ubuntu
, so my guess is that i'm missing something (fonts?) in the production (the amazon linux instance) server. I tried to install Google Noto
font but nothing happened. I'll attach 2 screens of the same HTML
page, generated by the same command via wkhtmltopdf
:
Local (Ubuntu):
Production (Amazon Linux):
As you can see, even the font below the broken emoji is not rendered as aspected, i'll add the command i use in both servers:
/my/path/to/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality 'file:///my/path/to/page-test-pdf.html' '/home/user/test.pdf'
Thanks for your time.
encoding wkhtmltopdf emoji amazon-linux
add a comment |
I'm trying to generate a PDF via wkhtmltopdf
in an Amazon Linux
os, everything works fine, but when i try to use emoji on the HTML
, the fonts break and the emoji is displayed as a black box.
Before deploying, i tried locally and it works, locally i have Ubuntu
, so my guess is that i'm missing something (fonts?) in the production (the amazon linux instance) server. I tried to install Google Noto
font but nothing happened. I'll attach 2 screens of the same HTML
page, generated by the same command via wkhtmltopdf
:
Local (Ubuntu):
Production (Amazon Linux):
As you can see, even the font below the broken emoji is not rendered as aspected, i'll add the command i use in both servers:
/my/path/to/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality 'file:///my/path/to/page-test-pdf.html' '/home/user/test.pdf'
Thanks for your time.
encoding wkhtmltopdf emoji amazon-linux
I'm trying to generate a PDF via wkhtmltopdf
in an Amazon Linux
os, everything works fine, but when i try to use emoji on the HTML
, the fonts break and the emoji is displayed as a black box.
Before deploying, i tried locally and it works, locally i have Ubuntu
, so my guess is that i'm missing something (fonts?) in the production (the amazon linux instance) server. I tried to install Google Noto
font but nothing happened. I'll attach 2 screens of the same HTML
page, generated by the same command via wkhtmltopdf
:
Local (Ubuntu):
Production (Amazon Linux):
As you can see, even the font below the broken emoji is not rendered as aspected, i'll add the command i use in both servers:
/my/path/to/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality 'file:///my/path/to/page-test-pdf.html' '/home/user/test.pdf'
Thanks for your time.
encoding wkhtmltopdf emoji amazon-linux
encoding wkhtmltopdf emoji amazon-linux
asked Nov 21 '18 at 9:27
Gumma MocciaroGumma Mocciaro
932720
932720
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can find a solution to a similar issue here basically twemoji.min.js
replace the emoji with the corresponding image. Regarding the weird font spacing issue, you can use a monospaced font like roboto mono
or something you like.
Thank you, it's not actually a solution but a workaround, but it works
– Gumma Mocciaro
Dec 4 '18 at 16:36
add a comment |
If you are running PHP 7.x, I have been having problems with the wkhtmltopdf extension within a dockerized image. We were trying to use font awesome and the text just did not render correctly. There were some compilation issues that caused this.
The problem was resolved when using the following binary https://github.com/madnight/docker-alpine-wkhtmltopdf
Hope this helps you forward.
EDIT: You will also have to have all fonts used installed as system fonts iirc otherwise wkhtmltopdf will refuse to work as it cannot find the font
unfortunately i need to use emoji because i need to generate a report for some push notifications (containing emoji), i actually refuse to map every emoji and replace it with something else, i think i need to install the right fonts in the server, moreover, i'll try the binary you linked instead the one i got from composer (i don't use docker in this project, but i guess this will not be a problem), thanks!
– Gumma Mocciaro
Nov 23 '18 at 9:41
I tried to use that binary but unfortunately is for 32bit OS, while i have 64Bit. I also tried to install the fonts in the server but it didn't help either. I wrote in the project's github so i'll just wait and hope
– Gumma Mocciaro
Nov 23 '18 at 10:51
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408891%2fwkhtmltopdf-amazon-linux-wont-encode-emoji%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can find a solution to a similar issue here basically twemoji.min.js
replace the emoji with the corresponding image. Regarding the weird font spacing issue, you can use a monospaced font like roboto mono
or something you like.
Thank you, it's not actually a solution but a workaround, but it works
– Gumma Mocciaro
Dec 4 '18 at 16:36
add a comment |
You can find a solution to a similar issue here basically twemoji.min.js
replace the emoji with the corresponding image. Regarding the weird font spacing issue, you can use a monospaced font like roboto mono
or something you like.
Thank you, it's not actually a solution but a workaround, but it works
– Gumma Mocciaro
Dec 4 '18 at 16:36
add a comment |
You can find a solution to a similar issue here basically twemoji.min.js
replace the emoji with the corresponding image. Regarding the weird font spacing issue, you can use a monospaced font like roboto mono
or something you like.
You can find a solution to a similar issue here basically twemoji.min.js
replace the emoji with the corresponding image. Regarding the weird font spacing issue, you can use a monospaced font like roboto mono
or something you like.
answered Dec 4 '18 at 16:35
panzapanza
263
263
Thank you, it's not actually a solution but a workaround, but it works
– Gumma Mocciaro
Dec 4 '18 at 16:36
add a comment |
Thank you, it's not actually a solution but a workaround, but it works
– Gumma Mocciaro
Dec 4 '18 at 16:36
Thank you, it's not actually a solution but a workaround, but it works
– Gumma Mocciaro
Dec 4 '18 at 16:36
Thank you, it's not actually a solution but a workaround, but it works
– Gumma Mocciaro
Dec 4 '18 at 16:36
add a comment |
If you are running PHP 7.x, I have been having problems with the wkhtmltopdf extension within a dockerized image. We were trying to use font awesome and the text just did not render correctly. There were some compilation issues that caused this.
The problem was resolved when using the following binary https://github.com/madnight/docker-alpine-wkhtmltopdf
Hope this helps you forward.
EDIT: You will also have to have all fonts used installed as system fonts iirc otherwise wkhtmltopdf will refuse to work as it cannot find the font
unfortunately i need to use emoji because i need to generate a report for some push notifications (containing emoji), i actually refuse to map every emoji and replace it with something else, i think i need to install the right fonts in the server, moreover, i'll try the binary you linked instead the one i got from composer (i don't use docker in this project, but i guess this will not be a problem), thanks!
– Gumma Mocciaro
Nov 23 '18 at 9:41
I tried to use that binary but unfortunately is for 32bit OS, while i have 64Bit. I also tried to install the fonts in the server but it didn't help either. I wrote in the project's github so i'll just wait and hope
– Gumma Mocciaro
Nov 23 '18 at 10:51
add a comment |
If you are running PHP 7.x, I have been having problems with the wkhtmltopdf extension within a dockerized image. We were trying to use font awesome and the text just did not render correctly. There were some compilation issues that caused this.
The problem was resolved when using the following binary https://github.com/madnight/docker-alpine-wkhtmltopdf
Hope this helps you forward.
EDIT: You will also have to have all fonts used installed as system fonts iirc otherwise wkhtmltopdf will refuse to work as it cannot find the font
unfortunately i need to use emoji because i need to generate a report for some push notifications (containing emoji), i actually refuse to map every emoji and replace it with something else, i think i need to install the right fonts in the server, moreover, i'll try the binary you linked instead the one i got from composer (i don't use docker in this project, but i guess this will not be a problem), thanks!
– Gumma Mocciaro
Nov 23 '18 at 9:41
I tried to use that binary but unfortunately is for 32bit OS, while i have 64Bit. I also tried to install the fonts in the server but it didn't help either. I wrote in the project's github so i'll just wait and hope
– Gumma Mocciaro
Nov 23 '18 at 10:51
add a comment |
If you are running PHP 7.x, I have been having problems with the wkhtmltopdf extension within a dockerized image. We were trying to use font awesome and the text just did not render correctly. There were some compilation issues that caused this.
The problem was resolved when using the following binary https://github.com/madnight/docker-alpine-wkhtmltopdf
Hope this helps you forward.
EDIT: You will also have to have all fonts used installed as system fonts iirc otherwise wkhtmltopdf will refuse to work as it cannot find the font
If you are running PHP 7.x, I have been having problems with the wkhtmltopdf extension within a dockerized image. We were trying to use font awesome and the text just did not render correctly. There were some compilation issues that caused this.
The problem was resolved when using the following binary https://github.com/madnight/docker-alpine-wkhtmltopdf
Hope this helps you forward.
EDIT: You will also have to have all fonts used installed as system fonts iirc otherwise wkhtmltopdf will refuse to work as it cannot find the font
answered Nov 22 '18 at 19:05
Matt SmeetsMatt Smeets
310213
310213
unfortunately i need to use emoji because i need to generate a report for some push notifications (containing emoji), i actually refuse to map every emoji and replace it with something else, i think i need to install the right fonts in the server, moreover, i'll try the binary you linked instead the one i got from composer (i don't use docker in this project, but i guess this will not be a problem), thanks!
– Gumma Mocciaro
Nov 23 '18 at 9:41
I tried to use that binary but unfortunately is for 32bit OS, while i have 64Bit. I also tried to install the fonts in the server but it didn't help either. I wrote in the project's github so i'll just wait and hope
– Gumma Mocciaro
Nov 23 '18 at 10:51
add a comment |
unfortunately i need to use emoji because i need to generate a report for some push notifications (containing emoji), i actually refuse to map every emoji and replace it with something else, i think i need to install the right fonts in the server, moreover, i'll try the binary you linked instead the one i got from composer (i don't use docker in this project, but i guess this will not be a problem), thanks!
– Gumma Mocciaro
Nov 23 '18 at 9:41
I tried to use that binary but unfortunately is for 32bit OS, while i have 64Bit. I also tried to install the fonts in the server but it didn't help either. I wrote in the project's github so i'll just wait and hope
– Gumma Mocciaro
Nov 23 '18 at 10:51
unfortunately i need to use emoji because i need to generate a report for some push notifications (containing emoji), i actually refuse to map every emoji and replace it with something else, i think i need to install the right fonts in the server, moreover, i'll try the binary you linked instead the one i got from composer (i don't use docker in this project, but i guess this will not be a problem), thanks!
– Gumma Mocciaro
Nov 23 '18 at 9:41
unfortunately i need to use emoji because i need to generate a report for some push notifications (containing emoji), i actually refuse to map every emoji and replace it with something else, i think i need to install the right fonts in the server, moreover, i'll try the binary you linked instead the one i got from composer (i don't use docker in this project, but i guess this will not be a problem), thanks!
– Gumma Mocciaro
Nov 23 '18 at 9:41
I tried to use that binary but unfortunately is for 32bit OS, while i have 64Bit. I also tried to install the fonts in the server but it didn't help either. I wrote in the project's github so i'll just wait and hope
– Gumma Mocciaro
Nov 23 '18 at 10:51
I tried to use that binary but unfortunately is for 32bit OS, while i have 64Bit. I also tried to install the fonts in the server but it didn't help either. I wrote in the project's github so i'll just wait and hope
– Gumma Mocciaro
Nov 23 '18 at 10:51
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408891%2fwkhtmltopdf-amazon-linux-wont-encode-emoji%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown