Query About PDF Show

i have made Sales /invoice Print format…but when i click on pdf button its shows an error like this…


how can i resolve this error…

@suvarna_bhangare

Can you please share your html and css code?

this is my code:

@page { size: A4 landscape; } @page:left{ @bottom-left { content: "Page " counter(page) " of " counter(pages); } }
							   </tr>
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp TAX INVOICE
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp Issued in terms of Section 31 of the Central Goods & Services Tax Act, 2017
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp Sacantech Laser Pvt.Ltd
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp A-517 TTC Indutrial Area Mahape MIDC Ghansoli 400710
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp &nbspCIN:U&2000TN2006PTC058932|PAN::AABCI5003K|GSTIN:{{ doc.company_gstin }}
							   </tr>
							   </tr>
							    <tr>
							   <th width="10%" style="text-align:center"> Transport Mode:</th>
							  <td width="12%" style="text-align:center"></td>
							   <th width="10%" style="text-align:center">State Code </th>
							   <td width="8%" style="text-align:center">05 </td>
							   <th width="12%"  style="text-align:center"> Date & Time of Suppply</th>
							  <td width="12%" style="text-align:center">{{ doc.get_formatted("due_date") }} </td>
							   
							   </tr>
Tax is payable On:&nbsp&nbsp&nbsp
	 {%- if doc.reverse_tax -%}
	     Yes 
	{%- else -%}
	   No	
             {%- endif %} 
Invoice No: {{ doc.name }} Invoice Date: {{doc.get_formatted("posting_date") }}
Courier Name: Blue Dart Weight 0.15kg Vehicle No.
Docket/AWB No: 345611892345 No of Boxes 1. Place Of Supply Mahatashtra Details of Reciver (Billed To) Details of Consignee(Shipped To)
		<tr>
                    <th><font size = "1">Sr</font></th>
		<th><font size = "1">Description</font></th>
		<th><font size = "1">Tariff/HSN</font></th>
		<th class="text-right"><font size = "1">Quantity</font></th>
		<th class="text-right"><font size = "1">Rate</font></th>
		<th class="text-right"><font size = "1">Amount</font></th>
		<th class="text-right"><font size = "1">CGST Rate</font></th>
		<th class="text-right"><font size = "1">CGST Amount</font></th>
		<th class="text-right"><font size = "1">SGST Rate</font></th>
		<th class="text-right"><font size = "1">SGST Amount</font></th>
		<th class="text-right"><font size = "1">IGST Rate</font></th>
		<th class="text-right"><font size = "1">IGST Amount</font></th>


                  </font>
	</tr>

	{% set cgst_rate = [] -%}
	 {% set sgst_rate = [] -%}
	 {% set igst_rate = [] -%}
	{% set cgst_account_head = [] -%}
	 {% set sgst_account_head = [] -%}
	 {% set igst_account_head = [] -%}
	{% set tot_cgst_amount = [] %}
	{% set tot_sgst_amount = [] %}
	{% set grand_total = {"qty":0.0, "amount":0.0, "cgst_amt":0.0, "sgst_amt":0.0, "igst_amt":0.0} %}

	{%- for row in doc.taxes -%}
  	   {% if 'CGST' in row.account_head -%}
		{% set _ = cgst_account_head.append(row.account_head) %}
		{% set _ = cgst_rate.append(row.rate) %}
		
	   {%- endif -%}
	   {% if 'SGST' in row.account_head -%}
		 {% set _ = sgst_account_head.append(row.account_head) %}
		{% set _ = sgst_rate.append(row.rate) %}
		
	   {%- endif -%}
	   {% if 'IGST' in row.account_head -%}

		{% set _ = igst_account_head.append(row.account_head) %}
		{% set _ = igst_rate.append(row.rate) %}
		
	   {%- endif -%}
	{%- endfor -%}

{%- for row in doc.items -%}
	<tr>
	        {% set cgst_amt = [] -%}
	 	 {% set sgst_amt = [] -%}
		 {% set igst_amt = [] -%}
		 {% set it_cgst_rate = [] -%}
	 	 {% set it_sgst_rate = [] -%}
		 {% set it_igst_rate = [] -%}
		 {% set rate_found_item = 0 -%}

							
	      {%- set item_record = frappe.get_doc("Item", row.item_code) -%}
		{% for item_tax in item_record.taxes %}

		  {% if item_tax.tax_type == igst_account_head[0] %}
			
			{% set _ = it_igst_rate.append(item_tax.tax_rate) %}
			{% set _ = igst_amt.append(row.amount * it_igst_rate[0] / 100) -%}
			{% set rate_found_item = 1 -%}
		{% endif %}		
		{% if item_tax.tax_type == sgst_account_head[0] %}
			
			{% set _ = it_sgst_rate.append(item_tax.tax_rate) %}
			{% set _ = sgst_amt.append(row.amount * it_sgst_rate[0] / 100) -%}
			{% set rate_found_item = 1 -%}
		{% endif %}	
		{% if item_tax.tax_type == cgst_account_head[0] %}
			{% set _ = it_cgst_rate.append(item_tax.tax_rate) %}
			{% set _ = cgst_amt.append(row.amount * it_cgst_rate[0] / 100) -%}
			{% set rate_found_item = 1 -%}
		{% endif %}		


	{% endfor %}	
  	{% if rate_found_item == 0 %}

		{% if cgst_rate[0] -%}
		   {% set _ = cgst_amt.append((row.amount * cgst_rate[0])/100) -%}
		   {% set _= it_cgst_rate.append(cgst_rate[0]) -%}
		   {% set rate_found_inv = 1 -%}
	       	{%- endif -%}
		{% if sgst_rate[0] -%}
		   {% set _ = sgst_amt.append((row.amount * sgst_rate[0])/100) -%}
		   {% set _= it_sgst_rate.append(sgst_rate[0]) -%}
		   
	       	{%- endif -%}
		{% if igst_rate[0] -%}
		   {% set _ = igst_amt.append((row.amount * igst_rate[0])/100) -%}
		   {% set _= it_igst_rate.append(igst_rate[0]) -%}
		   {% set rate_found_inv = 1 -%}
	       	{%- endif -%}
	{% endif %}


	{% if not it_cgst_rate[0] %}
		{% set _ = it_cgst_rate.append(0) %}
		{% set _ = cgst_amt.append(0) %}
	{% endif %}
	{% if not it_sgst_rate[0] %}
		{% set _ = it_sgst_rate.append(0) %}
		{% set _ = sgst_amt.append(0) %}
	{% endif %}
	{% if not it_igst_rate[0] %}
		{% set _ = it_igst_rate.append(0) %}
		{% set _ = igst_amt.append(0) %}
	{% endif %}

	{% set temp_cgst_amt = grand_total["cgst_amt"] + cgst_amt[0] %}
	{% set temp_sgst_amt = grand_total["sgst_amt"] + sgst_amt[0] %}
	{% set temp_igst_amt = grand_total["igst_amt"] + igst_amt[0] %}
	{% set temp_qty = grand_total["qty"] + row.qty %}
	{% set temp_amount = grand_total["amount"] + row.amount %}
	{% set check = grand_total.update({"qty": temp_qty, "amount": temp_amount, "cgst_amt":temp_cgst_amt, "sgst_amt":temp_sgst_amt, "igst_amt":temp_igst_amt}) %}
	
		<td style="width: 5%;"><font size = "1">{{ row.idx }}</font></td>
		<td style="width:25%;"><font size = "1">
			{% if row.item_code != row.item_name -%}
			<b>{{ row.item_code}}</b>
			{%- endif %}
                            {{ row.item_name }}
		</font></td>
		<td style="width: 6%;"><font size = "1">{{ row.gst_hsn_code }}</font></td>
		<td style="width: 6%; text-align: left;"><font size = "1">{{ row.uom or row.stock_uom }}&nbsp &nbsp &nbsp {{ row.qty }} </font></td>
		<td style="width: 10%; text-align: right;"><font size = "1">{{
			row.get_formatted("rate", doc) }}</font></td>
		<td style="width: 10%; text-align: right;"><font size = "1">{{
			row.get_formatted("amount", doc) }}</font></td>
		
		<td style="width: 4%; text-align: right;"><font size = "1">{{
			it_cgst_rate[0] }}%</font></td>
		<td style="width: 10%; text-align: right;"><font size = "1">{{
			"₹  {:,.2f}".format(cgst_amt[0])  }}</font></td>
		<td style="width: 4%; text-align: right;"><font size = "1">{{
			it_sgst_rate[0] }}%</font></td>
		<td style="width: 10%; text-align: right;"><font size = "1">{{
			" ₹ {:,.2f}".format(sgst_amt[0])  }}</font></td>
		<td style="width: 4%; text-align: right;"><font size = "1">{{
			it_igst_rate[0] }}%</font></td>
		<td style="width: 10%; text-align: right;"><font size = "1">{{
			" ₹ {:,.2f}".format(igst_amt[0])  }}</font></td>
{%- endfor -%}
{%- for row in doc.taxes -%} {%- if not row.included_in_print_rate -%}

Invoice Value(In Words):

( {{ doc.in_words }} )

Total {{ doc.get_formatted("net_total") }}
{{ row.description }}
	          {{ row.get_formatted("tax_amount", doc) }}
	
		</font></td>
	 </tr>
            
	{%- endif -%}
	{%- endfor -%}
	{%- if doc.discount_amount -%}
	<tr>
		<td class="text-right" width = "17%"><font size = "1">
			{{ ("Discount") }}
		</font></td>
		<td class="text-right" width = "17%"><font size = "1">
			{{ doc.get_formatted("discount_amount") }}
		</font></td>
	</tr>
	{%- endif -%}
	<tr>
		<td class="text-right" width = "17%"><font size = "1">
			<b>{{ ("Grand Total") }}</b>
		</font></td>
		<td class="text-right"  width = "17%"><font size = "1">
			{{ doc.get_formatted("grand_total") }}
		</font></td>
	</tr>
            <tr>
		<td class="text-right" width = "17%"><font size = "1">
			<b>{{ ("Rounded Total") }}</b>
		</font></td>
		<td class="text-right" width = "17%"><font size = "1">
			{{ doc.get_formatted("rounded_total") }}

		</font>
            </td>
	</tr>
      </table>
Others Terms:

This is to certify that the particulars given above are true and correct and the amount indicated represents the price actually charged and that there is no flow of any additional consideration, directly or indirectly, from the buyer or from any person on behalf of buyer.


For Scantech Laser Pvt.Ltd:

Authorised Signature

Hi @suvarna_bhangare are you able to see preview of your print format if yes then your html code seems to be right. check with your wkhtmltopdf version or it is installed or not .

yes…i m able to see preview of my print format…only problem is happnning when i click on pdf…
can u tell me plz how i get to know abt wkhtmltopdf version or iit is installed or not .

@suvarna_bhangare

To know the version number use this command

wkhtmltopdf --version

Dear Teram,

Below is the version of wktmltopdf is installed.

wkhtmltopdf 0.13.0-alpha-7b36694

how do i update OR link with ERPNext.?

pls suggest…