convert UI page to downloadable PDF

s_sakshi
Tera Contributor

Hello exports

I have created a UI action in problem table for download PDF .

but My current UI Action.

function exportPDF() {

var sysparm_table = g_form.getTableName();
var sysparm_sys_id = g_form.getUniqueValue().toString();
var instanceName = 'https://My instance name/';
var url = instanceName + sysparm_table + '.do?PDF&sys_id=' + sysparm_sys_id;
g_navigation.openPopup(url);


}

 

I have below requirements I'm struggling here to achieve pls support.

 

1.Add fixed Agenda on first page IN PDF format (if possible).

 

Thank you

4 REPLIES 4

Sai Kumar B
Mega Sage
Mega Sage

@s_sakshi 

 

In OOB we already have Export action to export records as PDF

 

SaiKumarB_0-1677226010633.png

 

If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022

 

 

we have a client requirement that we have an UI page which is called by export to PDF functionality or an UI action button to download that UI page into PDF format

There is a Script Include called TranslationLoader.

It contains code that renders UI Pages, Macros, Forms.

The only problem is that if your UI Page relies on parameters, it will not be possible to provide those.

If not, you can render the UI Page in script.

After that you can use the obtained HTML to feed it to the sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDFWithHeaderFooter() API to generate the PDF.

priyannka
Tera Contributor

Hello,
Did you get this requirement done?

Please let me know.

Thanks