When you integrating a Link to a Document in the Rich text filed, a Link Resolver function is necessary, when you render Rich text field in the frontend. Are you adding a Link Resolver function in your project? What framework are you using?
I am sending document link in javascript but you can find in other framework too:
And after creating linkResolver function pass this function to the Richtext where you are rendering this. Please find more details in this doc:Templating Rich Text fields - Prismic