PDF download damaged

Hello just a question,
I have a download server action following this approach

However the downloaded pdf displays a message that it is damaged.

Although if I use a static value to download the same file, opens successfuly.

Any ideas?
Thank you!

PS To make it more clear, the files that need to be downloaded works ok. The issue is that the downloaded file cant be opened and Acrobat displays the message that it is damaged

Hi Niko,
maybe show a few screenshots of what is defined for the server action, route, href etc. so we can check what’s wrong.

Thank you Teodor,
yes was about to check the routing too.
To not waste time I will try to access the file directly to see if this fixes the issue will let you know.

Thank you

Yes it has to do with the routing. Placing a direct link to the Server Action worked ok.
Thank you.