PDF to text conversion using convert API

Hi everyone,
I am trying to integrate convert API (https://www.convertapi.com/pdf-to-txt#snippet=json) for converting PDF files into text in my app. But I for the life of me can’t figure out how to initialize the API call and go about this integration. I have tried JSON and cURL formats both but I keep getting a “File size must be greater than 0 error”. I also don’t know how to configure this in such a way that it will take a dynamic input from a file uploader. Can anyone please walk me through the step by step process?

Hello, if you can give me access to you editor i maybe able to help you.

Thanks for the offer @Baloshi69 . I managed to do this bit by using the API format which allowed me send the file URL as a parameter in the API request itself.

However, am now stuck on a different problem- when I am trying to pass the URL of a file I have uploaded in Bubble to the external API- the API is not able to access the file- even after removing all the privacy restrictions :-/

See the formatting of url before giving it to external api

Thanks @Baloshi69 . I think I get what you mean. The url format is //s3.amazonaws.com/appforest_uf/f1681250793023x962788162250760600/xyz.pdf

I need to remove the // at the beginning. Any tips on how to do that ?

Truncate the first 2 characters :wink:

Thanks :smiley: Managed to do this using a regex because I think truncate would mean actually just returning the first 2 characters.

Regardless, it looks like Convert API still can’t access the file despite the URL now being correct (I can paste it in the browser and see a file). I get a 5009: File id is invalid error. Do you have any idea what might be happening there @Baloshi69 ? Really appreciate your patience in helping a newbie

Regex use resources, do mind it. And for the error see the documentation of API maybe it help.

Thanks @Baloshi69 . No luck with the documentation unfortunately. I have contacted their support team. Let’s see what they say

Add https: in front of the //s3… instead?

Can you view the file/open the link regularly in the browser from incognito?

Yah this can be, but don’t remove anything just add Https:

Thanks for the suggestions @tylerboodman and @Baloshi69 . I fiddled around more with the API and I managed to send a file directly. The API accepts formats which aren’t mentioned in their documentation :ok_man:

1 Like