Skip to content

SudoSOS Back-end API / helpers / sendPdfOrHtml

Function: sendPdfOrHtml() ​

ts
function sendPdfOrHtml(
   res, 
   buffer, 
   baseName, 
   fileType
): void;

Send a rendered document as an attachment with the content type and extension that match its file type.

Parameters ​

ParameterTypeDescription
resResponseThe express response
bufferBufferThe PDF or HTML bytes
baseNamestringFile name without extension
fileTypeReturnFileTypeWhether the buffer is the PDF or the raw HTML

Returns ​

void