Reputation: 35
When I finished writing the code to an NS advanced pdf template, I started to see an error that is not reflected in the code. Details about the error in 13 line: "Error on line 13, column 142 in template.
Detail...<tr> kid is <p> not <td>: ignoring
.
I tried to remove the code from the given line in which it occurs, but it did not give any effect, even if there is a comment to the whole if or the line is shifted, the given error pops up.
<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
<head>
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH"> <!-- in this line error appears -->
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
<style type="text/css">table { font-size: 9pt; table-layout: fixed; width: 100%; }
th { font-weight: bold; font-size: 8pt; vertical-align: middle; padding: 5px 6px 3px; background-color: #e3e3e3; color: #333333; padding-bottom: 10px; padding-top: 10px; }
td { padding: 4px 6px; }
b { font-weight: bold; color: #333333; }
</style>
</head>
<body>
</body>
</pdf>
How can I remove this error, or what could i do to solve my problem?
Upvotes: 0
Views: 2822
Reputation: 1
Use relational child tag, I got issue: " kid not or : ignoring" Cant use the table after the pdf tag, We should use the head tag first.
Upvotes: 0
Reputation: 3783
The reason your error message does not match up with an actual line in your template is due to how NetSuite processes Advanced PDF/HTML templates. There are two libraries at play. Firstly, your template is processed by Freemarker to merge in the fields from the record and produce an XML document, which is then passed to the BFO engine which renders the PDF. If there is an error in the BFO stage, the line number displayed will refer to a line in the generated Freemarker output, not in your original template.
In terms of the actual error you are experiencing, it sounds like your template has a <p>
tag as a direct child of a <tr>
.
<table>
<tr>
<p>Problematic p tag (direct child of table row element)</p>
</tr>
</table>
You need to add a <td>
tag
<table>
<tr>
<td>
<p>Paragraph is now correctly in a table cell (td)</p>
</td>
</tr>
</table>
Upvotes: 2