cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Save As PDF Through API

Re: Save As PDF Through API

IvanIgorevich
New member | Level 2

Hello! So, I can send my DOCX file to specific directory, where I set converting to PDF manually. And response will return dropbox_id. Then I immediately  downloaded this file via that dropbox_id - and will have pdf version of that file?

 

4 Replies 4

Здравко
Legendary | Level 20

@IvanIgorevich wrote:

... Then I immediately  downloaded this file via that dropbox_id - and will have pdf version of that file?


Hi @IvanIgorevich,

No, that's the original file (in your case .docx) id. And if you use it, the downloaded file will be the original one if not autoremoved. Automations produced files ids are for their internal use and they are not exported in any way. You may follow the naming convention though and access the converted files using path to those files once they become ready.

Maybe a better option in your case is to convert your document on your own instead of upload and download it - there are lots of free tools (libraries) to do that.

IvanIgorevich
New member | Level 2

Thanks for answer!
I tried to create this functionality, but can not find pdf file in folder for converting. For some reason 

dbx.filesSearchV2({
query: fileName,
options: {
path: folder,
max_results: 1,
},
});

returns `Response failed with a 400 code`, but works correctly in another folders in Dropbox. Ok, I will continue to use LibreOffice, which sometimes refuses to work without any clear reason(

Здравко
Legendary | Level 20

Hi again @IvanIgorevich,
There is no best way to do so. As seems you have an incorrect path - does it certainly starts with slash, for instance? 😉

I wouldn't recommend using search for this task though. It's very likely to find something you're not looking for! Search looks for similarities, not mandatory exact match. Keep this in mind. Maybe better way is to trace latest changes and listen to them - longpull.

Good luck.

Greg-DB
Dropbox Staff

@IvanIgorevich When you get a 400 error like that, inspect the error object, as it should contain a more useful error message indicating more specifically why the call failed.

 

In any case though, as Здравко said, there are other options for listing files and monitoring for changes that may be helpful. Check out the Detecting Changes Guide.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    IvanIgorevich New member | Level 2
What do Dropbox user levels mean?