ConvertAPI / convertapi-library-python

A Python library for the ConvertAPI
https://www.convertapi.com
Other
77 stars 22 forks source link

Files array syntax error in Python snippet #18

Closed tomasr78 closed 3 years ago

tomasr78 commented 3 years ago

@laurynas-baltsoft Could you confirm that the files array has syntax error for Python https://www.convertapi.com/pdf-to-merge ?

Current snippet

convertapi.convert('merge', {
    'Files[0]': '/path/to/complex.pdf',
    'Files[1]': '/path/to/vector.pdf',
    'Files[2]': '/path/to/my_file.pdf'
}, from_format = 'pdf').save_files('/path/to/dir')

Should be

convertapi.convert('merge', {
    Files: [
      '/path/to/complex.pdf',
      '/path/to/vector.pdf',
      '/path/to/my_file.pdf'
    ]
}, from_format = 'pdf').save_files('/path/to/dir')

Which one is correct?

laurynas-convertapi commented 3 years ago

Second is correct. Here is an example of passing files array: https://github.com/ConvertAPI/convertapi-python/blob/master/examples/split_and_merge_pdf.py#L17

kostas-jonauskas commented 3 years ago

Fixed