Saving a PDF File from Base 64 format using Suitescript

let html_Tag = '<?xml version="1.0"?><!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">n' +
                    '<pdf>n' +
                    '<head>n' +
                    '</head>n' +
                    '<body padding=".01in" width="605px" height="405px">n' +
                    '    <img src="data:image/gif;base64,'+base64decode+'" style=" width:600px; height:400px; margin-left:20px;"/>n' +
                    '</body>n' +
                    '</pdf>';
                    
                var myTemFile=render.create();
                myTemFile.templateContent = html_Tag;
                var pdfFile = myTemFile.renderAsPdf();

                pdfFile.name = fulfilId+".pdf";
                pdfFile.folder = FolderID;
                let id = pdfFile.save();

Leave a comment

Your email address will not be published. Required fields are marked *