I want to generate a PDF file for my purchase orders using HTML code

Hello! I want to generate a PDF file for my purchase orders using HTML code. Can you please check what is wrong with my code below. It is not working whenever I triggered the button to generate a pdf.

 

<!DOCTYPE html>
<html>
<head>

    <title>Purchase Order Template</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 1cm;
            line-height: 1.5;
        }
        .header, .footer {
            text-align: center;
            font-weight: bold;
        }
        .header {
            margin-bottom: 1cm;
        }
        .footer {
            margin-top: 1cm;
        }
        .section {
            margin-bottom: 0.5cm;
        }
        .section h3 {
            margin-bottom: 0.3cm;
        }
        .table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 0.5cm;
            font-size: 12px;
        }
        .table th, .table td {
            border: 1px solid #000;
            padding: 6px;
            text-align: left;
        }
        .notes {
            margin-top: 0.5cm;
        }
    </style>
</head>
<body>
  <div class="PO">
    <div class="header">
        <h1>Refrigeration House Contracting Company</h1>
        <h2>PURCHASE ORDER</h2>
        <h3>Order Details</h3>
    </div>

    <div class="section">
        <h3>Supplier Information</h3>
        <p>
            <strong>Supplier:</strong> &lt;&lt;[Supplier Name]&gt;&gt;<br>
            <strong>Contact Person:</strong> &lt;&lt;[Contact Person]&gt;&gt;<br>
            <strong>Address:</strong> &lt;&lt;[Address]&gt;&gt;<br>
            <strong>Purchase Order No.:</strong> &lt;&lt;[PO No.]&gt;&gt;<br>
            <strong>PO Date:</strong> &lt;&lt;[PO Date]&gt;&gt;<br>
            <strong>Incoterm:</strong> Ex-Works &lt;&lt;[Origin]&gt;&gt;<br>
            <strong>Payment Term:</strong> &lt;&lt;[Payment Terms]&gt;&gt;
        </p>
    </div>

    <div class="section">
        <h3>Ship To</h3>
        <p>
            Mr. Mohammed Baiju<br>
         <PII REMOVED BY STAFF>
        </p>
    </div>

    <table class="table">
        <thead>
            <tr>
                <th>SN</th>
                <th>Code No.</th>
                <th>Description</th>
                <th>Quantity</th>
                <th>Net Price</th>
                <th>Total Price</th>
            </tr>
        </thead>
        <tbody>
            <!-- Dynamic rows start here -->

                <td>&lt;&lt;Start: [Related PO Items]&gt;&gt;&lt;&lt;[No.]&gt;&gt;</td>
                <td>&lt;&lt;[Item No.]&gt;&gt;</td>
                <td>&lt;&lt;[Item Description]&gt;&gt;</td>
                <td>&lt;&lt;[Requested Qty]&gt;&gt;</td>
                <td>&lt;&lt;[Unit Price]&gt;&gt;</td>
                <td>&lt;&lt;[Ext. Price (Open)]&gt;&gt;&lt;&lt;[End]&gt;&gt;</td>
            </tr>

            <!-- Dynamic rows end here -->
        </tbody>
    </table>

    <p><strong>Subtotal:</strong> &lt;&lt;[Currency]&gt;&gt; &lt;&lt;[Open Amount]&gt;&gt;</p>

    <div class="notes">
        <h3>Notes:</h3>
        <p>
            &lt;&lt;[Note1]&gt;&gt;<br>
            &lt;&lt;[Additional Note]&gt;&gt;<br>
            &lt;&lt;[Note2]&gt;&gt;<br>
            &lt;&lt;[Note3]&gt;&gt;<br>
            &lt;&lt;[Note4]&gt;&gt;<br>
            &lt;&lt;[Note5]&gt;&gt;<br>
            &lt;&lt;[Note6]&gt;&gt;
        </p>
    </div>

    <div class="footer">
        <table style="width: 100%;">
            <tr>
                <td style="text-align: center;">
                    Eng. Mohammed Baiju<br>
                    <span style="font-weight: normal;">Regional Sales Manager</span>
                </td>
                <td style="text-align: center;">
                    Mohammed Ziou Ziou<br>
                    <span style="font-weight: normal;">Branch Manager</span>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>

 

 @Aleksi @Jonathon @WillowMobileSys @SkrOYC 

0 10 508
10 REPLIES 10
Top Labels in this Space