Getting started with TMS FNC Cloud File Conversion
Prerequisites
- TMS FNC Core installed and the runtime package added to the project.
- TMS FNC Cloud Pack installed.
- An API key for one of the supported conversion services: CloudConvert (default), Convert.io, or Zamzar.
Add the component
- Drop
TTMSFNCCloudFileConversiononto a form (or create it in code). - Select the backend with
Serviceand setAPIKey. - Call
ConvertFile(orConvertFileFromURL/ConvertFileFromBase64) and handleOnConvertJobFinished.
Minimal example
Set the API key, convert a local file to PDF, and read the result once it finishes:
procedure TForm1.ConvertReportToPDF;
begin
TMSFNCCloudFileConversion1.OnConvertJobFinished := FileConversionJobFinished;
TMSFNCCloudFileConversion1.ConvertFile('C:\local\report.docx', fcfPdf);
end;
procedure TForm1.FileConversionJobFinished(Sender: TObject;
const ARequestResult: TTMSFNCCloudBaseRequestResult;
AJob: TTMSFNCCloudFileConversionJob; AStatus: TTMSFNCCloudFileConversionJobStatus);
begin
if AStatus = fcjsSuccessful then
Memo1.Lines.Add('Converted, ' + IntToStr(AJob.OutputFiles.Count) + ' file(s) ready')
else
Memo1.Lines.Add('Conversion did not succeed: ' + TTMSFNCCloudFileConversion.GetStatusText(AStatus));
end;
Next steps
- Authentication — selecting a service and setting the API key
- Converting files — starting a conversion and detecting completion automatically
- Downloading results — downloading output files and listing job history
- API reference — full class reference