Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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
The API doesn't support converting file formats, but I'll be sure to pass this along as a feature request.
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
so how can i pass my file the .doc file can you please give me some code example for objective-c
Are you using a particular SDK or library, or are you calling the HTTPS endpoints directly?
i am using dropbox sdk in my ios app
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.
can you please provide some same code for
https://www.dropbox.com/developers-v1/core/docs#previews
so i can get a preview.
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.
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
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!