Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
whizpool t.
10 years agoNew member | Level 1
how to get all files in pdf format can dropbox convert before i download it through the API
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
Replies have been turned off for this discussion
- Alexandra F.110 years agoNew 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.110 years agoNew 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.10 years agoNew 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-DB10 years ago
Dropbox Community Moderator
Are you using a particular SDK or library, or are you calling the HTTPS endpoints directly?
- whizpool t.10 years agoNew member | Level 1
i am using dropbox sdk in my ios app
- Greg-DB10 years ago
Dropbox Community Moderator
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.10 years agoNew 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-DB10 years ago
Dropbox Community Moderator
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.10 years agoNew 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 - Greg-DB10 years ago
Dropbox Community Moderator
What's the value of dropboxPath? Are you sure that "<Acess Token>" is linked to the same app and account as pMainDelegate.restClient?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!