Custom templates

Custom templates

We are using Zoho Books with a custom module called Partner-Fulfilled Order.

Templates created using the Default Editor, including clones of Elegant Life, display correctly in the Change Template preview.

Templates created using the Code Editor, even when the original HTML is left completely unchanged, appear in the template selection list but do not display a preview.

When attempting to change to a Code Editor template, we receive:

Premature end of file — lineNumber: 1; columnNumber: 1

In some cases, PDF downloads also fail with ERR_INVALID_RESPONSE.

However, Code Editor templates have successfully generated PDFs under other circumstances.

Is this a known limitation or defect affecting Code Editor templates in custom modules? Is there a supported way to generate PDFs and switch templates without triggering the preview error?

Also, does "change template" on a PDF preview require a successful preview before applying the selected template.