danfickle / openhtmltopdf

An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!
https://danfickle.github.io/pdf-templates/index.html
Other
1.93k stars 360 forks source link

BALLOT BOX WITH CHECK is getting rendered as Hash #939

Closed heenamittal-nagarro closed 1 year ago

heenamittal-nagarro commented 1 year ago
<html>
    <head>
        <meta charset="UTF-8"/>
        <title></title>
        <style>
@font-face {  font-family: 'noto';  /* Note: No trailing format tag is allowed. */  src: url(fonts/NotoSerif-Regular.ttf);  font-weight: normal;  font-style: normal; }

body {
    font-family: noto;
}
        u {    
            border-bottom: 1.5px dotted #000;
            text-decoration: none;
        }
        p {
            color: #243e66;
            font-weight: bold;
        }
        i {
            color: #243e66;
            font-style: normal;
        }
        .checked:before{
            content: "\2611";
        }
        .unchecked:before{
            content: "\2610";
        }

            .values {
                color: grey;
            }
            table, th, td {
            border: 1px solid black;
            border-collapse: collapse;
            white-space: nowrap;
            overflow: hidden;
        }

            .tick {
            }

            .table1{
                   border:none;
                    margin-left: 5%;
                    font-size:12px;
                    border-collapse: collapse;
                    text-align:left;
                    width: 80%;
                    color: #243e66;
                }
            .table2{
                    border:0.2px solid #000;
                    margin-left: 5%;
                    font-size:12px;
                    border-collapse: collapse;
                    text-align:left;
                    width: 80%;
                    color: #243e66;
                }
                td,tr,th{
                    border: none;
                    text-align:left;
                }
                .myDiv {
                    padding-left:5px;
                    padding-top:5px;
                    padding-right:5px;
                    font-weight: bold;
                }
        </style>
    </head>
    <body >

<i class="checked"></i> Yes to marketing by all of the above
</body>
</html>
YashSwarajSingh commented 1 year ago

You need to use a font that is able to display BALLOT BOX WITH CHECK. Arial Unicode MS is one such font (it has all the UTF-8 characters). Make sure you install the font using "pdfrendererbuilder.useFont" and then also use it in the HTML(or VM) file.

heenamittal-nagarro commented 1 year ago

You need to use a font that is able to display BALLOT BOX WITH CHECK. Arial Unicode MS is one such font (it has all the UTF-8 characters). Make sure you install the font using "pdfrendererbuilder.useFont" and then also use it in the HTML(or VM) file.

Thanks, this worked for me !