wkhtmltopdf displaying text as blocks





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







4















We're using wkhtmltopdf in a web project (nodejs/compoundjs). We've gotten it working how we wanted on our machines (using the --use-xserver switch). However, when I try to run this on our Ubuntu server 12.04 (without the ubuntu-desktop package), the PDF cannot use the switch. When we disable the switch, the PDF displays any characters as blocks (image below).



How do I resolve this without installing ubuntu-desktop and running x server?



I've found liberation fonts, which installing ttf-liberation and fonts-liberation did not help. And urw-fonts, but I have yet to find an Ubuntu equivalent.



PDF Output



EDIT: It just hit me, this doesn't matter if I'm on the server or not. On my development machine (Ubuntu 13.04 desktop), I can run the following, which produces the same blocks:



wkhtmltopdf http://google.com google1.pdf


While this prints out the pdf properly:



wkhtmltopdf --use-xserver http://google.com google2.pdf


My version of wkhtmltopdf is 0.12.0.










share|improve this question

























  • I've just learned that PhantomJS also supports capturing to PDF, if that helps at all.

    – ændrük
    Nov 8 '13 at 21:42











  • @ændrük, Thanks for the suggestion. I've heard of it as well, but we've used wkhtmltopdf in other projects (.NET/Windows Server) and already have this implemented to how we like it.

    – making3
    Nov 8 '13 at 22:08


















4















We're using wkhtmltopdf in a web project (nodejs/compoundjs). We've gotten it working how we wanted on our machines (using the --use-xserver switch). However, when I try to run this on our Ubuntu server 12.04 (without the ubuntu-desktop package), the PDF cannot use the switch. When we disable the switch, the PDF displays any characters as blocks (image below).



How do I resolve this without installing ubuntu-desktop and running x server?



I've found liberation fonts, which installing ttf-liberation and fonts-liberation did not help. And urw-fonts, but I have yet to find an Ubuntu equivalent.



PDF Output



EDIT: It just hit me, this doesn't matter if I'm on the server or not. On my development machine (Ubuntu 13.04 desktop), I can run the following, which produces the same blocks:



wkhtmltopdf http://google.com google1.pdf


While this prints out the pdf properly:



wkhtmltopdf --use-xserver http://google.com google2.pdf


My version of wkhtmltopdf is 0.12.0.










share|improve this question

























  • I've just learned that PhantomJS also supports capturing to PDF, if that helps at all.

    – ændrük
    Nov 8 '13 at 21:42











  • @ændrük, Thanks for the suggestion. I've heard of it as well, but we've used wkhtmltopdf in other projects (.NET/Windows Server) and already have this implemented to how we like it.

    – making3
    Nov 8 '13 at 22:08














4












4








4


1






We're using wkhtmltopdf in a web project (nodejs/compoundjs). We've gotten it working how we wanted on our machines (using the --use-xserver switch). However, when I try to run this on our Ubuntu server 12.04 (without the ubuntu-desktop package), the PDF cannot use the switch. When we disable the switch, the PDF displays any characters as blocks (image below).



How do I resolve this without installing ubuntu-desktop and running x server?



I've found liberation fonts, which installing ttf-liberation and fonts-liberation did not help. And urw-fonts, but I have yet to find an Ubuntu equivalent.



PDF Output



EDIT: It just hit me, this doesn't matter if I'm on the server or not. On my development machine (Ubuntu 13.04 desktop), I can run the following, which produces the same blocks:



wkhtmltopdf http://google.com google1.pdf


While this prints out the pdf properly:



wkhtmltopdf --use-xserver http://google.com google2.pdf


My version of wkhtmltopdf is 0.12.0.










share|improve this question
















We're using wkhtmltopdf in a web project (nodejs/compoundjs). We've gotten it working how we wanted on our machines (using the --use-xserver switch). However, when I try to run this on our Ubuntu server 12.04 (without the ubuntu-desktop package), the PDF cannot use the switch. When we disable the switch, the PDF displays any characters as blocks (image below).



How do I resolve this without installing ubuntu-desktop and running x server?



I've found liberation fonts, which installing ttf-liberation and fonts-liberation did not help. And urw-fonts, but I have yet to find an Ubuntu equivalent.



PDF Output



EDIT: It just hit me, this doesn't matter if I'm on the server or not. On my development machine (Ubuntu 13.04 desktop), I can run the following, which produces the same blocks:



wkhtmltopdf http://google.com google1.pdf


While this prints out the pdf properly:



wkhtmltopdf --use-xserver http://google.com google2.pdf


My version of wkhtmltopdf is 0.12.0.







fonts pdf wkhtmltopdf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 25 '17 at 8:01









Martin Thoma

7,001165275




7,001165275










asked Oct 23 '13 at 18:56









making3making3

12126




12126













  • I've just learned that PhantomJS also supports capturing to PDF, if that helps at all.

    – ændrük
    Nov 8 '13 at 21:42











  • @ændrük, Thanks for the suggestion. I've heard of it as well, but we've used wkhtmltopdf in other projects (.NET/Windows Server) and already have this implemented to how we like it.

    – making3
    Nov 8 '13 at 22:08



















  • I've just learned that PhantomJS also supports capturing to PDF, if that helps at all.

    – ændrük
    Nov 8 '13 at 21:42











  • @ændrük, Thanks for the suggestion. I've heard of it as well, but we've used wkhtmltopdf in other projects (.NET/Windows Server) and already have this implemented to how we like it.

    – making3
    Nov 8 '13 at 22:08

















I've just learned that PhantomJS also supports capturing to PDF, if that helps at all.

– ændrük
Nov 8 '13 at 21:42





I've just learned that PhantomJS also supports capturing to PDF, if that helps at all.

– ændrük
Nov 8 '13 at 21:42













@ændrük, Thanks for the suggestion. I've heard of it as well, but we've used wkhtmltopdf in other projects (.NET/Windows Server) and already have this implemented to how we like it.

– making3
Nov 8 '13 at 22:08





@ændrük, Thanks for the suggestion. I've heard of it as well, but we've used wkhtmltopdf in other projects (.NET/Windows Server) and already have this implemented to how we like it.

– making3
Nov 8 '13 at 22:08










2 Answers
2






active

oldest

votes


















0














This bug report suggests that wkhtmltopdf just needs whatever xorg-x11-fonts provides:



$ wajig list-installed xfonts
xfonts-base
xfonts-encodings
xfonts-mathml
xfonts-scalable
xfonts-utils


So try installing those. Note that you'll pull in several X dependencies, but not the server itself.






share|improve this answer


























  • I have all of these xfonts on my dev machine and it gives the same results. I'm looking into trying to find the correct xfonts package through the package manager.

    – making3
    Nov 8 '13 at 21:50



















0














In fact wkhtmltopdf on linux requires quite a lot of Xorg as mentioned on the project page:




(Linux) No longer requires an XServer to be running (however the X11 client libs must be installed)




You should install the client libs as well.






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    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
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f364590%2fwkhtmltopdf-displaying-text-as-blocks%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









    0














    This bug report suggests that wkhtmltopdf just needs whatever xorg-x11-fonts provides:



    $ wajig list-installed xfonts
    xfonts-base
    xfonts-encodings
    xfonts-mathml
    xfonts-scalable
    xfonts-utils


    So try installing those. Note that you'll pull in several X dependencies, but not the server itself.






    share|improve this answer


























    • I have all of these xfonts on my dev machine and it gives the same results. I'm looking into trying to find the correct xfonts package through the package manager.

      – making3
      Nov 8 '13 at 21:50
















    0














    This bug report suggests that wkhtmltopdf just needs whatever xorg-x11-fonts provides:



    $ wajig list-installed xfonts
    xfonts-base
    xfonts-encodings
    xfonts-mathml
    xfonts-scalable
    xfonts-utils


    So try installing those. Note that you'll pull in several X dependencies, but not the server itself.






    share|improve this answer


























    • I have all of these xfonts on my dev machine and it gives the same results. I'm looking into trying to find the correct xfonts package through the package manager.

      – making3
      Nov 8 '13 at 21:50














    0












    0








    0







    This bug report suggests that wkhtmltopdf just needs whatever xorg-x11-fonts provides:



    $ wajig list-installed xfonts
    xfonts-base
    xfonts-encodings
    xfonts-mathml
    xfonts-scalable
    xfonts-utils


    So try installing those. Note that you'll pull in several X dependencies, but not the server itself.






    share|improve this answer















    This bug report suggests that wkhtmltopdf just needs whatever xorg-x11-fonts provides:



    $ wajig list-installed xfonts
    xfonts-base
    xfonts-encodings
    xfonts-mathml
    xfonts-scalable
    xfonts-utils


    So try installing those. Note that you'll pull in several X dependencies, but not the server itself.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 13 '17 at 12:23









    Community

    1




    1










    answered Nov 8 '13 at 21:30









    ændrükændrük

    42.4k61195343




    42.4k61195343













    • I have all of these xfonts on my dev machine and it gives the same results. I'm looking into trying to find the correct xfonts package through the package manager.

      – making3
      Nov 8 '13 at 21:50



















    • I have all of these xfonts on my dev machine and it gives the same results. I'm looking into trying to find the correct xfonts package through the package manager.

      – making3
      Nov 8 '13 at 21:50

















    I have all of these xfonts on my dev machine and it gives the same results. I'm looking into trying to find the correct xfonts package through the package manager.

    – making3
    Nov 8 '13 at 21:50





    I have all of these xfonts on my dev machine and it gives the same results. I'm looking into trying to find the correct xfonts package through the package manager.

    – making3
    Nov 8 '13 at 21:50













    0














    In fact wkhtmltopdf on linux requires quite a lot of Xorg as mentioned on the project page:




    (Linux) No longer requires an XServer to be running (however the X11 client libs must be installed)




    You should install the client libs as well.






    share|improve this answer




























      0














      In fact wkhtmltopdf on linux requires quite a lot of Xorg as mentioned on the project page:




      (Linux) No longer requires an XServer to be running (however the X11 client libs must be installed)




      You should install the client libs as well.






      share|improve this answer


























        0












        0








        0







        In fact wkhtmltopdf on linux requires quite a lot of Xorg as mentioned on the project page:




        (Linux) No longer requires an XServer to be running (however the X11 client libs must be installed)




        You should install the client libs as well.






        share|improve this answer













        In fact wkhtmltopdf on linux requires quite a lot of Xorg as mentioned on the project page:




        (Linux) No longer requires an XServer to be running (however the X11 client libs must be installed)




        You should install the client libs as well.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 15 '13 at 14:04









        don.joeydon.joey

        17.9k126695




        17.9k126695






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • 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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f364590%2fwkhtmltopdf-displaying-text-as-blocks%23new-answer', 'question_page');
            }
            );

            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







            Popular posts from this blog

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?