The method does not change the source file whose ID is passed in thefileId parameter. Instead, it creates a temporary file.
Converting to .pdf is available for the fillowing file formats:
.xls, .xlsx, .xlt, .xltx;
.doc, .docx, .dot, .dotx;
.rtf.
Use example:
// Get ID of the file to be converted to .pdf const fileId = Context.data.fileToConvert.id;
// Convert the file to .pdf const tmpFile = await System.converter.toPdf(fileId);
//Createa a persistent file const file_persist = await Context.fields.test_result. createFromLink('file_name.pdf', await tmpFile.getDownloadUrl());
Object for converting documents
Hierarchy
Methods
toPdf
Convert a file to .pdf.
The method does not change the source file whose ID is passed in the
fileIdparameter. Instead, it creates a temporary file. Converting to .pdf is available for the fillowing file formats:// Get ID of the file to be converted to .pdf const fileId = Context.data.fileToConvert.id; // Convert the file to .pdf const tmpFile = await System.converter.toPdf(fileId); //Createa a persistent file const file_persist = await Context.fields.test_result. createFromLink('file_name.pdf', await tmpFile.getDownloadUrl());Parameters
fileId: string
Returns Promise<FileItemRef>
The instance of FileItemRef referencing a temporary file in the .pdf format.