# Print Rich Text Editor Field as PDF/WORD

**URL:** <https://forums.pega.com/t/print-rich-text-editor-field-as-pdf-word/9780>\
**Category:** User Experience\
**Tags:** 24-1, email, low-code-app-development, cross-industry, user-experience, pega-academy, system-architect, pega-customer-service\
**Created:** [July 29, 2025, 8:04am UTC](https://forums.pega.com/t/print-rich-text-editor-field-as-pdf-word/9780 "2025-07-29T08:04:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GustavoBezerraNeto](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@GustavoBezerraNeto](https://forums.pega.com/u/GustavoBezerraNeto)\
**Post date:** [July 29, 2025, 8:04am UTC](https://forums.pega.com/t/print-rich-text-editor-field-as-pdf-word/9780/1 "2025-07-29T08:04:30Z")

</div>

Hello everyone, i have a requirement to print the content of the Rich text Editor field as a PDF , i tried using the HTMLToPDF activity and others that i found on the pega baseclass and Work- class.

But without success.

I’m setting a template on the pre process of the flow action in the rich text editor field, and i need to print it after some changes on the field by clicking on a button on the same screen and printing the content of the RIch text editor as a PDF.

Does anyone know a way of doing it?

---

<div class="post-metadata">

**Author:** ![RaviChandra](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@RaviChandra](https://forums.pega.com/u/RaviChandra)\
**Post date:** [July 29, 2025, 8:21pm UTC](https://forums.pega.com/t/print-rich-text-editor-field-as-pdf-word/9780/2 "2025-07-29T20:21:01Z")

</div>

@GustavoBezerraNeto

Generating a PDF always takes a section as a template, even in Constellation architecture.

PFB the article related to generating a PDF using a Section as a wrapper-

> **[Pegasystems Documentation](https://docs.pega.com/bundle/platform/page/platform/user-experience/generating-pdf-constellation.html)**

This approach holds valid for Theme-Cosmos based app as well.

I would suggest you to create a wrapper section which refers to the RTE.

Also, You can use the OOTB ‘Print’ action which needs a Harness named ‘PrintView’ and in that harness you can refer the wrapper section above which refers to the RTE.

Also it entirely depends on the intention of Generating a PDF- if you want to attach the generated PDF on a case, the approach changes to running an activity on a click of a button and perform a AttachContent using the generated PDF steram.

Let me know your thoughts on the implementation and requirement if this doesnt solve your query

---

<div class="post-metadata">

**Author:** ![GustavoBezerraNeto](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@GustavoBezerraNeto](https://forums.pega.com/u/GustavoBezerraNeto)\
**Post date:** [July 30, 2025, 7:26am UTC](https://forums.pega.com/t/print-rich-text-editor-field-as-pdf-word/9780/3 "2025-07-30T07:26:34Z")

</div>

@RaviChandraThanks for the explanation,

Do you have any example about how to reference the RTE on the section? Either on the HTML source or in another way on a section?

Basically, the RTE will suffer some changes on the doc, so after this changes, the user will press a button to download the file/ pre visualize it.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![RaviChandra](https://avatars.discourse-cdn.com/v4/letter/r/ccd318/32.png) [@RaviChandra](https://forums.pega.com/u/RaviChandra)\
**Post date:** [July 30, 2025, 8:34am UTC](https://forums.pega.com/t/print-rich-text-editor-field-as-pdf-word/9780/4 "2025-07-30T08:34:16Z")

</div>

@GustavoBezerraNeto

- Create a section that has RTE as an item and refer to the Clipboard property where your changes made in the RTE will be saved.
- Include This Section in a Non-Auto Generated HTML Section. Use below syntax-

\<pega:include name=“YourRichTextSectionName” /\>

- Use `HTMLToPDF` Activity to Convert to PDF

`HTMLStream` `-->` The HTML content to convert (his Section in a Non-Auto Generated HTML Section).

`PDFDocument -->` Name of the output PDF file.

`pyOutputType -->` Set to `"PDF"`.

Let me know if there you need any additional information

---

<div class="post-metadata">

**Author:** ![GustavoBezerraNeto](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@GustavoBezerraNeto](https://forums.pega.com/u/GustavoBezerraNeto)\
**Post date:** [July 30, 2025, 9:46am UTC](https://forums.pega.com/t/print-rich-text-editor-field-as-pdf-word/9780/5 "2025-07-30T09:46:48Z")

</div>

@RaviChandra  
I tried your solution, but PEGA doesnt find the section even to save making the reference directly. The section need to be in the work layer because it will be used for all cases.

If you have any input, i appreciate, gonna try to find a workaround.

Thanks again
