Images from the Rich text editor is converted to PDF

In the Rich text editor, user is allowed to add text and image( upload and copy/past).

I am passing the HTML generated from text editor into the HTLM rule using property reference. If i preview the HTML rule, i could see the text and images I uploaded in text editor.

But when I try download PDF based on that HTML, I am not getting the image in PDF.

Tried given image url as external URL in for image control in section. But still no image in PDF.

If i give image from binary file, it is working.

@BalasubramaniM8354 you are on a legacy, unsupported version.

Pega Extended Support program

Keeping current with Pega

Please upgrade asap in order to be on the most secure platform possible.

Who can I contact with questions about the Extended Support Policy?

If you have questions about Extended Support, contact Pega Support or your Client Success Manager. For contact information, see Pega Support Contact Information.

You may want to log a support ticket via the MSP in order to request HFIX-54014


Below a GenAI response:

Here are the specific references I used for the information provided:

  1. For the compatibility issue between Rich Text Editor’s image handling and PDF conversion:
    Using images in emails and PDF’s
    This article confirms that “using Image Content rules and pega:contentURL tags aren’t compatible” and that “Using a Binary File and hard-coding the reference to that works fine.”
  2. For the HFix-46090 that addresses issues with images having spaces in their titles:
    RTE - Images are not exporting to PDF (Image title with spaces)
    This discussion specifically mentions that for Pega 7.4, HFix-46090 resolves the issue with spaces in image filenames.
  3. For the HTMLtoPDF activity parameters:
    HTMLtoPDF parameters
    This documentation explains the various parameters including the isCacheClear parameter I mentioned, which “removes all objects (images, CSS) from internal PD4ML caches when set to true.”

For additional information on PDF generation with binary files:
Images not displaying in PDF (generation using PD4ML)

This appears to be a known compatibility issue between the Rich Text Editor’s image handling and the PDF conversion process in Pega 7.4. Specifically, when HTML generated from the Rich Text Editor is passed to an HTML rule using property reference, the images are visible in the HTML preview but don’t render in the PDF output.

Why This Is Happening

The core issue relates to how image references are handled during PDF conversion. In Pega 7.4, there’s a compatibility issue between Image Content rules and the pega:contentURL tags that are typically used in the Rich Text Editor. While these work fine for HTML display, they don’t translate properly during the PDF conversion process.

Confirmed Solutions

You’ve already discovered one working solution - using binary file images works correctly. This aligns with the recommended workaround from Pega Support. When you use a Binary File and hard-code the reference to the image, the PDF conversion process can properly render the image.

Additional Recommendations

  1. Use Binary Files with Hard-Coded References
    • Continue using binary files as you’ve found this works
    • Use the format: <img alt="" src="binary-file-location"/>
  2. Check for Image Title Issues
    • If your images have spaces in their filenames, this could be contributing to the problem
    • There’s a specific hotfix for Pega 7.4 (HFix-46090) that addresses issues with images having spaces in their titles not exporting to PDF
  3. Alternative Approach
    • Instead of passing the HTML generated from the text editor directly, you could extract the images from the HTML
    • Store these images as binary files
    • Reconstruct the HTML with hard-coded references to these binary files
    • This would be more complex but might provide a more robust solution
  4. Review PDF Generation Parameters
    • If you’re using the HTMLtoPDF activity directly, you might want to review the parameters being used
    • Ensure that any caching parameters are properly set (e.g., Param.isCacheClear = true)