- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 01:03 PM
Hello,
I am trying to use PDFGenerationAPI to create a PDF of a record(similar to export PDF functionality), and attach it to the same record. Based on the documentation the API only seems to have the option to create a PDF with HTML, not a url. Can this API do what I am looking for? If it can't, is there another way to solve this problem?
Thanks in advance!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 01:13 PM
Hey Brad,
You can use code provided on the below link to fullfil your needs.
Regards,
Muhammad
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 01:13 PM
Hey Brad,
You can use code provided on the below link to fullfil your needs.
Regards,
Muhammad
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2022 01:18 PM
You can also try this in the UI action which I'm using already. Change Username and Password in the below script before execution.
UI ACTION SCRIPT:
createPDF();
function createPDF() {
var rm = new sn_ws.RESTMessageV2();
rm.setHttpMethod('GET');
var url = gs.getProperty("glide.servlet.uri") + current.getTableName() + '.do?PDF&sys_id=' + current.sys_id;
gs.addInfoMessage(url);
rm.setEndpoint(url);
// Create new properties and save user id and password of an admin account
rm.setBasicAuth('USERNAME', 'PASSWORD'); // Replace USERNAME and PASSWORD with actual username and password.
rm.saveResponseBodyAsAttachment(current.getTableName(), current.sys_id, current.number + ".pdf");
var response = rm.execute();
action.setRedirectURL(current.getTableName() + ".do?sys_id=" + current.sys_id);
}
Muhammad