Loading

Salesforce CPQ Quote Template: Failed to Load PDF Document

Udgivelsesdato: Oct 9, 2026
Beskrivelse

Salesforce CPQ (Configure, Price, Quote) Quote Templates consist of multiple Template Sections. When a Salesforce CPQ Quote Template cannot render a quote document in Portable Document Format (PDF), the preview or generation fails with the error message "Failed to Load PDF Document".

Symptoms

  • Generating or previewing a quote document from a Salesforce CPQ Quote Template displays "Failed to Load PDF Document".
  • The error appears for one template but not for others.
  • The error often appears after Quote Templates are migrated from a sandbox to production, or after custom HTML content is added to a template section.

Causes

The error occurs when at least one part of the Salesforce CPQ Quote Template contains content that the PDF renderer cannot process. Common causes include:

  • Invalid hexadecimal color codes: Color fields on the Quote Template or its sections must contain a valid hexadecimal color code, such as 000000 (black) or FF0000 (red). Migrating records with Data Loader from a spreadsheet can save "000000" as "0" when the spreadsheet cells are formatted as numbers instead of text.
  • Broken Line Items sections: A Line Items section fails when a custom field API name is misspelled or when a field referenced in a line column contains a null value.
  • Unsupported HTML content: An HTML section fails when it contains tags or formatting that the Template Content editor does not support, which commonly happens when content is pasted from a formatted source such as Microsoft Office.
Løsning

The following steps isolate the Salesforce CPQ Quote Template section that causes the error and then correct it. Always work on a cloned copy so the original template remains available as a backup.

Isolate the Failing Template Section

  1. Clone the Salesforce CPQ Quote Template with the Clone with Related button. If the button is missing, add it to the Quote Template page layout first. The result is a copy that includes all related sections.
  2. On the cloned template, remove one section at a time and preview the template after each removal. When the document renders successfully, the last section removed is the one causing the error.
  3. Continue removing sections one at a time if other sections might also contain errors. Only one section can be identified per pass.
  4. Add the failing section to a brand-new Quote Template as the only section. This template serves as a test template for the fix.
  5. If the document renders after every section is removed individually, repeat the process with the content in Header Content and Footer Content. This identifies whether the error is in the header or footer instead of the body sections.

Check Color Codes on the Quote Template

  1. Open the Quote Template Detail page and review every color field. Each value must be a valid hexadecimal color code, such as 000000 or FF0000. A value of "0" is invalid.
  2. Open each section by clicking the Section Name in the Sections related list on the Quote Template record and review the color fields there.
  3. Correct any invalid value (for example, change "0" back to "000000") and preview the template to confirm that the PDF now renders.
  4. When migrating Quote Templates with a spreadsheet and Data Loader, format the spreadsheet cells as text instead of numbers. This prevents values such as "000000" from being converted to "0".

Fix Line Items Section Errors

  1. If the failing section is of type Line Items, recreate the section from scratch. A new section removes any corrupted configuration carried over from the original.
  2. Verify that every custom field API name used in the section is spelled correctly, including the namespace prefix and the __c suffix for custom fields.
  3. Confirm that no field referenced in the line columns contains a null value. Populate or remove the field and preview the template to confirm that the error no longer appears.

Fix HTML Section Errors

  1. If the failing section is of type HTML, go to Template Content and click the name of the cloned Template Content record. The record opens in a detail view.
  2. Click Edit to open the content editor.
  3. Delete tables, rows, or columns one at a time. Save and preview the template after each deletion. When the document renders, the last deleted element contains the problematic code.
  4. Recreate the removed content with the Template Content editor tools. Do not paste from a formatted document source such as Microsoft Office, because pasted content often adds unsupported markup.
  5. Use only supported HTML tags and formatting. Not all HTML tags and formatting options are supported. The article Supported HTML tags in CPQ Quote Templates lists the supported tags.
  6. Preview the template to confirm that the PDF renders, then apply the same correction to the original Quote Template.
Vidensartikelnummer

000383958

 
Indlæser
Salesforce Help | Article