ConvertAPI / convertapi-library-go

A Go library for the ConvertAPI
https://www.convertapi.com
Other
14 stars 8 forks source link

Introduce alternative converter parameter in conversion method #7

Closed tomasr78 closed 4 years ago

tomasr78 commented 4 years ago

Some formats have several converters, for example docx to pdf has three of them listed below. It should be a possibility to set up an alternative converter from the library in the Convert method.

https://v2.convertapi.com/convert/docx/to/pdf https://v2.convertapi.com/convert/docx/to/pdf/converter/openoffice https://v2.convertapi.com/convert/docx/to/pdf/converter/printer

This is only an example of a convert method on how it could implement alternative converters.

Default method

convertapi.ConvDef("docx", "pdf",
    param.NewPath("File", "/path/to/my_file.docx", nil),
).ToPath("/path/to/result/dir");

with alternative converter

convertapi.ConvDef("docx", "pdf","openoffice"
    param.NewPath("File", "/path/to/my_file.docx", nil),
).ToPath("/path/to/result/dir");
JonasJasas commented 4 years ago

Done