How to Generate and Preview PDF from a word template without downloading it

Hi,

I need to generate a pdf and preview it directly when I click a button

I have an action set on-click that calls an activity that will generate pdf based on the word template and the mail merge that I provided. Then, I run script “pega.ui.HarnessActions.doAttachmentSingleClick”

But, it is downloading the pdf instead of previewing it. I don’t want to download the pdf, I want to preview pdf in Pega

Does anyone know how to preview the pdf?

Thank you

Hi @Intandhp: If you are using Theme-Cosmos, files and documents utility pane by default has the feasibility to preview pdf files. Even it is working with a application built on UI-Kit in version 8.7.4.

May I know if your application is migrated from a older version? If this is the case you may need to refactor the codes to use latest feature (please check the impacts for older attachments too ).

Please also have a look into this which speaks about a custom implementation.

Thanks.

@Intandhp did you already try the suggestions in past forum questions?