Skip to main content

The source file which I use in my code is clear, but the envelope sent to email is bad quality. Please help me

Hello,

 

Thank you for reaching out. There are a couple of things that you can check in relation to this. First, I would suggest trying different browsers to see if the issue persists between them. Secondly, when you upload the document to Docusign, we flatten and convert the document to a PDF. Depending on the file type, this can cause blurriness when the conversion happens. You could try to convert the file to a PDF first if it isn’t already one to see if that helps.

 

If the problem persist, please feel free to open a support case and we’d be happy to take a look at this with you: https://support.docusign.com/s/?language=en_US

 

Best regards,

Jonathan | Docusign Developer Support


I have already opened a support case before and they said the same thing. I tried flattening the document in my code, it didn’t help. Issue does persist throughout different browsers. And I also checked the pdf document im uploading - it was clear.

here is the snippet of my code, if it helps

 

ff.http('docusignFunc', async (req: ff.Request, res: ff.Response) => {
try {
console.log('Req Body', req.body);
const uuid = req.body.uuid;
const submission = await getSubmission(uuid);
const dbData: SheetSubmission = submissioni0];
console.log(dbData);
let sheetId;
console.log('dbData', dbData);
let temporarySheetId;
const submissionType = dbData.submissionType;
if (submissionType === 'Customer') {
sheetId = dbData.copiedSheetId;
replaceFormulasWithValues(sheetId, 758694374);
temporarySheetId = await copyQuotationToTemporarySheet(sheetId, 758694374);
} else if (submissionType === 'Installer') {
sheetId = dbData.copiedSheetId;
replaceFormulasWithValues(sheetId, 1591261569);
temporarySheetId = await copyQuotationToTemporarySheet(sheetId, 1591261569);
} else {
res.status(400).send(`Unknown submissionType: ${submissionType}`);
return;
}

console.log('Temporary sheet ID', temporarySheetId);

let pdfBase64 = await exportTemporarySheetAsPdf(temporarySheetId);
pdfBase64 = await removeFirstPage(pdfBase64);

console.log('PDF After page 1 is gone', pdfBase64);

const privateKeyBuffer = Buffer.from(privateKey, 'utf-8');
dsApiClient.setBasePath(baseUri);
const results = await dsApiClient.requestJWTUserToken(
integrationKey,
userId,
'signature'],
privateKeyBuffer,
3600,
);

const accessToken = results.body.access_token;
const fileName = `Quotation_${uuid}.pdf`;
const uploadedFileId = await uploadPdfToDrive(fileName, pdfBase64, parentFolderId);

console.log('Uploaded file to Google Drive, File ID:', uploadedFileId);

let envelopesApi = getEnvelopesApi(accessToken);

console.log('PDF before making enveloper', pdfBase64);

let envelope;

if (submissionType === 'Customer') {
envelope = makeEnvelope(
dbData.applicant_email,
dbData.applicant_name,
pdfBase64,
submissionType,
);
} else {
envelope = makeEnvelope(dbData.installer_email, 'Mr Installer', pdfBase64, submissionType);
}

console.log('Envelope', envelope);

let createRes = await envelopesApi.createEnvelope(accountId, { envelopeDefinition: envelope });

console.log('Envelope', createRes);

res.status(200).json({
message: 'PDF created and envelope sent via DocuSign',
});
} catch (err) {
console.error('Error:', (err as Error).message);
}
});

 


please someone


Reply