Symptom
When generating a document in word, it is possible to visually see additional lines are created rather then in PDF document.
Environment
SAP CPQ
Reproducing the Issue
It is needed to have table cells containing placeholder tags (e.g. <<C_TAG_>>).
- Generate document in word format
- Generate document in PDF format
- There is a different in line sizes for each format.
Resolution
The difference in how the document appears in Word versus PDF is caused by the way rendering engines interpret dynamic content within table structures. If placeholders tags (e.g. <<C_TAG_>>) are used in combination with table cells, it could be they are longer and occupy more space than the final content that replaces them during generation, resulting in:
-
If the final value is shorter than the placeholder, the row height may decrease in the PDF output.
-
If the final value wraps into multiple lines or includes special formatting (such as line breaks), the row height may increase.
In contrast to Word, which maintains the visual structure based on placeholder size, the PDF output adjusts purely based on the real content that is inserted. This leads to a natural variation in table row heights.
This behavior is also influenced by the nature of the PDF format itself. Unlike Word, which is designed for editing and layout flexibility, PDF is a fixed-layout format optimized for precise rendering. Word may visually preserve space for placeholders and apply implicit spacing, whereas PDF rendering relies entirely on explicit formatting and final content. Because of this, even well-structured templates can produce different visual results between Word and PDF when dynamic content is involved.
PDF rendering engine does not "remember" the visual size or formatting of the placeholder tags in Word. It formats the document purely based on the final values that are inserted into each cell.
To minimize visual differences, templates should define clear formatting rules (such as minimum row height and cell padding), but due to content variability and the fixed nature of PDF rendering, some degree of variation is expected.
Keywords
word generation, line spacing, document format, cpq, sales cloud, template format, dynamic content, rendering engines, pdf output, table structures , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Bug Filed