PDF Component not rendering PDF Url

  • Goal: Dynamically render a PDF based on a presignedUrl returned from an API

  • Steps: I'm currently using the PDF Component. I'm using the "PDF Source": "Url" method. It appears that this works for some PDFs but not all.

  • Details: I'm calling an API to receive a presignedUrl to a PDF in an S3 bucket. I then use a query and call pdf1.setFileUrl(GetReport.data.presignedUrl) to render the report. However, I receive an error "PDF Could Not Be Loaded".

I verified that the presignedUrl is really returning a PDF, shown in the image below:

Hello @Chris_Walker!

Very odd that the PDF component works for most of your URL but not that specific one :thinking:

My best guess is to compare that URL against a working URL you got from your s3 bucket resource and see if there are any discrepancies in the formatting of the URLs which might be confusing our component.

I wish the component had a better error to best direct you as to why that one URL works when you put it in the browser but no when it is being read. If there is any way to alter the URL to be more similar to the others which are working correctly that would be by best guess.

I was thinking if trying to replicate the bug with the same URL to see if it works on my apps but I think the permissions might not allow for my app to get the photo.

You might need to store the photo in an intermediary/proxy image host that does work for PDF displaying. Getting image data directly from an S3 bucket can sometimes have issues that are hard to troubleshoot :sweat_smile: