cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: how to get all files in pdf format can dropbox convert before i download it through the API

how to get all files in pdf format can dropbox convert before i download it through the API

whizpool t.
New member | Level 1

I have doc file on my dropbox when i access these files from my app i want them to be in pdf 
techincally i want them to be downloaded in pdf

19 Replies 19

Alexandra F.1
New member | Level 1

The API doesn't support converting file formats, but I'll be sure to pass this along as a feature request. 

Alexandra F.1
New member | Level 1

By the way, have you looked at the /get_previews endpoint? Depending on the file type, that can return a PDF version of the file. Try passing your .doc files from your app to /get_previews, and let us know if the returned content suits your needs.

Documentation: https://www.dropbox.com/developers/documentation/http/documentation#files-get_preview

More on file previews for various file types on Dropbox: https://www.dropbox.com/en/help/6

whizpool t.
New member | Level 1

so how can i pass my file the .doc file can you please give me some code example for objective-c

Greg-DB
Dropbox Staff

Are you using a particular SDK or library, or are you calling the HTTPS endpoints directly?

whizpool t.
New member | Level 1

i am using dropbox sdk in my ios app

Greg-DB
Dropbox Staff

Do you mean the iOS Core SDK? That uses API v1, which does have an equivalent endpoint:

https://www.dropbox.com/developers-v1/core/docs#previews

Unfortunately, that's not implemented in the iOS Core SDK, and we don't have any sample code for doing it. That being the case, you would need to implement it in your app's code. 

whizpool t.
New member | Level 1

can you please provide some same code for

https://www.dropbox.com/developers-v1/core/docs#previews

so i can get a preview.

Greg-DB
Dropbox Staff

Unfortunately I don't have any sample code for implementing this endpoint in Objective-C. If you try it and run in to any issues though, feel free to share your code and we'll offer whatever help we can.

whizpool t.
New member | Level 1

        NSString * authorizToken = @"Bearer <Acess Token>";

 

        NSURL *url = [NSURL URLWithString:[[NSString stringWithFormat:@"https://content.dropboxapi.com/1/previews/auto/%@",dropboxPath ] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]  ];

        

    

        NSMutableURLRequest *request =

        [NSMutableURLRequest requestWithURL:url

                                cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData

                            timeoutInterval:10

         ];

       

        [request setValue:authorizToken forHTTPHeaderField:@"Authorization"];

 

        [request setHTTPMethod: @"GET"];

        

        NSError *requestError = nil;

        NSURLResponse *urlResponse = nil;

        

        

        NSData *response1 =

        [NSURLConnection sendSynchronousRequest:request

                              returningResponse:&urlResponse error:&requestError];

        [response1 writeToFile:pdfPath atomically:YES];


Error fie not found

when i do this

      [pMainDelegate.restClient searchPath:@" forKeyword:dropboxData.fileName];
it returns that file exits and in the rest client there is no method which helps me in call the https://content.dropboxapi.com/1/previews/auto


 

Need more support?