Accessing PDF objects (R2) using custom domain

I am using R2 to store PDF files and have a custom domain mapped for public access. The problem, though, is as follows.

So, I have a file of size ~240 KB. Now if I download from R2 dashboard, it works fine. However, when I use the object url (based on custom domain), the downloaded file contains only a portion of the file (< 30 KB). Obviously, the result is that neither the browsers nor any pdf applications are able to open it. I keep getting errors saying the file is damaged or something like that.

Some additional info : I have tried setting the Content-Type (for the object) to be “application/pdf”. Also tried setting transform rules to modify the header “Content-Type” as “application/pdf”. No success though.

Greatly appreciate any help you can provide. Thank you.