Letter Template Troubleshooting Guide
Letter Template Troubleshooting Guide
Use this guide when your generated PDF doesn't look the way you expect. Each section covers a specific symptom, what causes it, and how to fix it.
Packages: Basic | Standard | Premium Roles: Owner | Technical Owner
Raw HTML tags appear as text in the PDF
Symptom: The PDF shows literal text like <h1>Offer Letter</h1> or <p>Dear John,</p> instead of rendered content.
Cause: Your HTML content is missing the <body> wrapper tag. Without it, the renderer treats the content as plain text and outputs everything literally.
Fix: Wrap all of your Content tab HTML inside <body> tags:
<body>
<h1>Offer Letter</h1>
<p>Dear {{name.preferred}},</p>
<!-- rest of your content -->
</body>Unexpected borders on tables
Symptom: Tables that should be borderless (such as a two-column layout header) have gray borders around every cell.
Cause: ChartHop's default stylesheet applies border: 1px solid gray to all table, tr, td, and th elements. This applies to every template unless overridden.
Fix: Add the following to your Stylesheet tab to remove all borders, then add them back selectively where needed:
table, tr, td, th { border: none; }Inline styles are not applying
Symptom: A style you've written as style="color: red;" on an element has no effect in the PDF.
Cause: The PDF renderer sometimes ignores inline style attributes, particularly for layout-critical properties like margins, padding, and display.
Fix: Move styles to the Stylesheet tab and apply them via CSS classes:
- Add a class rule to the Stylesheet tab: .highlight { color: red; }
- Apply the class in the Content tab: <p class="highlight">Important notice.</p>
Inline styles may still work for simple properties like color on some elements, but CSS classes are the reliable approach.
Emoji appear as # or blank boxes
Symptom: Emoji characters in your template render as # symbols or blank boxes in the PDF.
Cause: The PDF renderer's embedded font set does not include emoji glyphs.
Fix: Remove all emoji from your template and replace them with text or standard ASCII characters. For example:
- Replace a checkmark emoji with the word "Yes" or the HTML entity ✓ (✓).
- Replace a warning emoji with the word "Note:" or "Important:".
The preview looks fine but the downloaded PDF is different
Symptom: The preview panel in the template editor shows the layout correctly, but when you download the PDF, fonts, spacing, or layout elements look different.
Cause: The preview panel renders HTML using your browser's engine, while the PDF uses ChartHop's server-side renderer. These do not behave identically, especially for complex CSS.
Fix: Always verify your template by downloading a test PDF before distributing. Use the Generate PDFs flow for a real employee, then download and inspect the output.
Common differences between preview and PDF:
- Custom fonts may not load in the PDF if the font URL is inaccessible to the server.
- Flexbox and CSS Grid may appear to work in the browser preview but break in the PDF. Use <table> layouts instead.
- Page breaks only apply in the downloaded PDF, not the preview panel.
Table closing tags appear as visible text
Symptom: Stray text like </td> or </table> appears in the middle of the rendered PDF.
Cause: Deeply nested <table> elements can cause the renderer to misparse closing tags, outputting them as literal text.
Fix: Keep table nesting to two levels maximum. If you need a complex layout, restructure it using fewer nested tables rather than going three or more levels deep.
Also verify that every opening tag has a matching closing tag and that your HTML is well-formed. Unclosed tags can cause cascading rendering issues.
A field code is showing as literal text (e.g., {{title}})
Symptom: The PDF shows the field code text itself, like {{title}}, instead of the person's job title.
Causes and fixes:
- Typo in the field code. Double-check the field code against the Dynamic Fields Reference. Field codes are case-sensitive.
- The field has no value for that employee. Preview the template for a different employee to see if the issue is data-specific.
- Custom field code is wrong. Go to Settings > Fields and confirm the exact field code for the custom field you're trying to use.
- Curly braces are not formatted correctly. The correct format is {{fieldCode}} with two curly braces on each side, no spaces inside.
Page breaks are not working
Symptom: Content that should start on a new page appears on the same page as the preceding content.
Cause: Inline style="page-break-after: always;" is ignored by the renderer.
Fix: Use a CSS class for page breaks. In the Stylesheet tab:
.pagebreak { page-break-after: always; }In the Content tab:
<div class="pagebreak"></div>Page breaks only appear in the downloaded PDF. They are not visible in the preview panel.
Font is not rendering in the PDF
Symptom: The PDF uses a default font (like Times New Roman or Arial) even though you specified a different font in your Stylesheet tab.
Causes and fixes:
- Font URL is not publicly accessible. The PDF renderer fetches fonts from the URL you specify. Make sure the font file is hosted publicly and accessible without authentication.
- Font file format is unsupported. Use .woff2 or .woff format.
- Missing fallback font. Always include a web-safe fallback: font-family: 'YourFont', Arial, sans-serif;
- Font not applied to <body>. Set the font on the body element in your Stylesheet tab to apply it globally:
body { font-family: 'YourFont', Arial, sans-serif; }Still stuck?
If none of the above resolves your issue, try the following steps:
- Simplify your template to the minimum needed to reproduce the problem.
- Test with a simple <body><p>Hello {{name.first}}</p></body> to confirm basic rendering works.
- Add complexity back piece by piece to identify the specific element or style causing the issue.
- Contact ChartHop Support with the specific symptom and the simplified template that reproduces it.
