Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Apr 04, 2016 8:32 pm

Hello
I'm using Spire PDF to convert HTML to PDF. I'm using 'Helvetica' font in me HTML (i also tested with 'sans-serif' font) but after converting text in pdf become faded. I couldn't find a way to embed font into pdf. I tried to search online for solution but i couldn't find any. View attached pdf that i have converted from html.

HTS-SAL_4.zip


Kindly help me to fix this problem

Thanks
Anjum Habib
[email protected]

anjum.piro
 
Posts: 4
Joined: Wed Mar 09, 2016 1:58 pm

Tue Apr 05, 2016 2:58 am

Hi,

Thanks for your posting.
Please provide us your html file or a url to help us investigate your issue.
Thank you.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Tue Apr 05, 2016 5:28 am

Hello
Thanks for your reply. following is my HTMl.

Code: Select all
<html>
<head>
    <style>
        .clearfix {
            clear: both;
            width: 100%;
        }

        .bold {
            font-weight: bold;
        }

        .left {
            float: left;
        }

        .right {
            float: right;
        }

        .text-center {
            text-align: center;
        }

        .text-left {
            text-align: left;
        }

        .text-right {
            text-align: right;
        }

        .border {
            border: 1px solid #7F7F7F;
        }

        .border-left {
            border-left: 1px solid #7F7F7F;
        }

        .border-top {
            border-top: 1px solid #7F7F7F;
        }

        body {
            /*background: gray;*/
            /*font-family:Helvetica;*/
            font-family: sans-serif;
        }
        .text-size {
            font-size: 12px !important;
        }
        .heading-size {
            font-size: 14px !important;
        }
        .wrapper {
            width: 100%;
            /*margin: 20px;*/
            /*width: 50%;
            margin: auto;
            background: #fff;
            padding: 20px;*/
        }

        .width40 {
            width: 40%;
        }
       
        .row {
            width: 100%;
            /*margin: auto;*/
            /*display: inline-block;*/
            margin-bottom: 25px;
        }
        .no-margin-bottom {
            margin-bottom:0;
        }
        .terms {
            position: absolute;
            bottom: 0;
        }
        .signature {
            margin-top: 20%;
        }
        .logoImg {
            width: 100%;
            max-width: 100%;
        }

        .companyName {
            margin-top: 2px;
        }

        ul {
            margin: 0;
            padding: 0;
            list-style: none;
        }

            ul li {
            }

        .invoice_title {
            text-transform: uppercase;
            color: #949494;
        }



        table {
            border-spacing: 0;
            border-collapse: collapse;
            width: 100%;
        }

            table tr th, table tr.header, table tfoot tr td {
                background-color: #96beff;
                /*text-transform: uppercase;*/
                padding: 5px;
            }

            table tr td {
                padding: 5px;
            }

        .stamp {
            margin: 20px;
        }
    </style>
</head>
<body>
    <div class="wrapper">
        <div class="row no-margin-bottom">

            <div class="left text-left width40">
                    <div>
                        <img src="http://www.bluecap-pos.com/Data/Company/2/images/logo(1).png" class="logoImg"/>
                    </div>
                <ul class="text-size">
                        <li>Al Khair Industry, </li>
                                            <li>
                                Dammam,
                                                            Eastern Province,
                                                            11
                        </li>
                                            <li>Phone # 013-8086388</li>
                </ul>
            </div>

            <div class="right text-right width40">
                <h1 class="invoice_title">Invoice</h1>

                <table class="right text-center" width="50%">
                    <tr class="header heading-size">
                        <th class="border">Invoice #
                        </th>
                        <th class="border">Date
                        </th>
                    </tr>
                    <tr class="text-size">
                        <td class="border">
                            BCS/16_4
                        </td>
                        <td class="border">
                            24/02/2016
                        </td>
                    </tr>
                    <tr class="header heading-size">
                        <th class="border" colspan="2">Customer ID
                        </th>
                       
                    </tr>
                    <tr class="text-size">
                        <td class="border" colspan="2">
4                        </td>
                       
                    </tr>
                </table>
            </div>
            <div class="clearfix"></div>
        </div>

        <div class="row">
            <div class="left width40">
                <table>
                    <tr class="heading-size">
                        <th class="border">Bill To
                        </th>
                    </tr>
                    <tr class="text-size">
                        <td>
                                <ul>
                                    <li>
                                        APU Dammam Maint Coordinator
                                    </li>
                                    <li>
                                        Panda
                                    </li>
                                    <li>
                                        Al Raka
                                    </li>
                                    <li>
                                        Al Khobar, Eastern region,
                                    </li>
                                    <li>
                                        +966 13
                                    </li>
                                    <li>
                                        [email protected]
                                    </li>
                                </ul>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="right width40">
                <table>
                    <tr class="heading-size">
                        <th class="border">Ship To
                        </th>
                    </tr>
                    <tr class="text-size">
                        <td>
                                <ul>
                                    <li>
                                        APU Dammam Maint Coordinator
                                    </li>
                                    <li>
                                        Panda
                                    </li>
                                    <li>
                                        Al Raka
                                    </li>
                                    <li>
                                        Al Khobar, Eastern region,
                                    </li>
                                    <li>
                                        +966 13
                                    </li>
                                </ul>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="clearfix"></div>
        </div>

        <div class="row">
            <table class="border">
                <thead>
                    <tr class="heading-size">
                        <th class="text-left">Description
                        </th>
                        <th class=" text-center">Qty
                        </th>
                        <th class=" text-right">Unit Price
                        </th>
                       
                        <th class=" text-right">Amount (SR)
                        </th>
                    </tr>
                </thead>
                <tbody>
                        <tr class="text-size">
                            <td class="border-top text-left">Hydraulic service</td>
                            <td class="border-top text-center">1</td>
                            <td class="border-top text-right">190</td>
                           
                            <td class="border-top text-right">190</td>
                        </tr>
                        <tr class="text-size">
                            <td colspan="4">
                                total hydraulic servicing
                            </td>
                        </tr>
                        <tr class="text-size">
                            <td class="border-top text-left">Wheel</td>
                            <td class="border-top text-center">4</td>
                            <td class="border-top text-right">90</td>
                           
                            <td class="border-top text-right">360</td>
                        </tr>
                        <tr class="text-size">
                            <td colspan="4">
                                trolley front wheel
                            </td>
                        </tr>

                </tbody>
                <tfoot>
                    <tr>
                        <td class="border-top" colspan="4" style="padding: 0;">
                            <table>
                                <tr class="text-size">
                                    <td colspan="2" rowspan="3" style="vertical-align: top; width:60%;"></td>
                                    <td class="border-left bold" style="min-width:50px;">Sub Total
                                    </td>
                                    <td class="text-right bold" style="min-width:50px;">
                                        SR 550
                                    </td>
                                </tr>
                                <tr class="text-size">
                                    <td class="border-left bold">Discount </td>
                                    <td class="text-right bold">
                                         SR 3
                                    </td>
                                </tr>
                                <tr class="text-size">
                                    <td class="border-left border-top bold">Total</td>
                                    <td class="text-right border-top bold">
                                        SR 535
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </tfoot>
            </table>
        </div>

        <div class="row text-size">
            <div class="left signature">
                Signature: __________________
            </div>
            <div class="right">
                    <img class="stamp" src="http://www.bluecap-pos.com/Data/Company/2/images/blue%20001(1).jpg" />
            </div>
            <div class="clearfix"></div>
        </div>

       
    </div>
</body>
</html>

anjum.piro
 
Posts: 4
Joined: Wed Mar 09, 2016 1:58 pm

Tue Apr 05, 2016 6:20 am

Hello,

Thanks for your html file.
I have tested the file and noticed your issue. I have forwarded it to our dev team. We will inform you once it is resolved.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Tue Apr 05, 2016 6:53 am

Hi.
Thanks for your quick response. If you can tell me an estimate when you can reply me with solution it will be good for me so i can schedule my tasks accordingly.

Thanks
Anjum Habib

anjum.piro
 
Posts: 4
Joined: Wed Mar 09, 2016 1:58 pm

Tue Apr 05, 2016 9:17 am

Hello,

There is a new method of converting HTML to PDF with new plugin. Please have a try, and there is a tutorial on our website.
http://www.e-iceblue.com/Tutorials/Spir ... lugin.html
If there is any problem, welcome to get it back to us.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Return to Spire.PDF