Embed link and download pdf

Hi Team,

We have a requirement to embed a S3 pdf file link in QuickSight and on clicking the link, users should be able to download the file.

I have analyzed the options, I do find URL action through which we can navigate to a URL but is it possible to embed and download a file from QuickSight? Please help

@Max

1 Like

Hi @Madhu,
Yes, you can embed your PDF into your QuickSight dashboard using custom visual content. This will allow your users to view the PDF within the dashboard, as well as download it via the PDF viewer’s download option without ever having to leave your dashboard.

If your PDF URLs are part of a dataset, you can leverage a parameter and navigation action to for example update the embedded PDF depending on which element in a table has been selected by a user. To do so, follow these steps:

  1. Create a parameter that will contain the PDF URL (without the “https://” prefix) - NOTE: Add a default value if you want certain content (PDF or HTML page) to be displayed before a user selects something from the table. Alternatively, you could use the conditional rules to hide the custom visual content until a selection has been made.
  2. Ensure that your dataset contains a field with the PDF URL without the “https://” prefix. This can be achieved by adding a calculated field to your dataset.
  3. Add a new visual of type Custom visual content and click on Customize visual to enter the following URL leveraging the previously defined parameter:
https://<<$pPDFLink>>

pdfLink_custom_visual_content
4. Create a new action on your Table visual as shown on the following screenshot to update the parameter value based on the user’s selection in the table (note that Sheet 15 is a self-reference of the sheet that the visuals are on, hence, the sheet does not change). It is important to add the parameter to the action and link it to the URL link field from step 2:
pdfLink_action

Now, users can view and download PDFs that are embedded into your dashboard based on a selection of a row in a table:

I hope my solution worked for you. Let us know if this is resolved. And if it is, please help the community by marking his answer as a “Solution”.

4 Likes

Thanks @Thomas for sharing the detailed steps. I will try the steps and keep the forum updated.
Additionally, I would like to check on below scenario.

If a user has QuickSight access but not S3 bucket access, can they still access the file (placed in S3 bucket) through embedded links in QuickSight ?

1 Like

Hi @Thomas - I believe we need to expose the document when store in S3 as public. If we put the file in a private S3 bucket, is this going to work in QuickSight? Please advise.

Regards -San

If you include external content in a QuickSight dashboard (not matter if images or content via the custom visual content), users will be able to see anything that they are allowed to access within their browser. QuickSight does not apply any additional authentication or authorization mechanisms on top of them. Meaning, if you for example include content from your internal CRM system using a custom visual content and your users are authenticated via some SSO mechanism to your CRM system, they will be able to load and view that content within the QuickSight dashboard.

The same applies to content/documents stored in S3: As long as your end users are able to access it from within their browser, it can be included in a QuickSight dashboard. This content/document does not have to be publicly accessible. There are multiple ways how you can make them accessible in a secure way: You could, for example, make them accessible via an API that is secured with your companies preferred authentication mechanism.

I hope this helps to understand how the integration of external content in QuickSight works at the moment.

3 Likes

hi @Thomas thanks. I will review this. When we will put an object in S3, we can give the access to the user so that they can see and down load it ( generate the pre-assigned URLs) but there is a timeout for that ( please have a look on S3 documentation - Using presigned URLs - Amazon Simple Storage Service). Can we use the same idea in QuickSight by considering QuickSight user have the access to S3.

By saying that i will do a POC on the same in coming days and update.

Tagging @Biswajit_1993 as well for our discussion.

Regards - San

1 Like

We embed a lambda function that returns the PDF. The lambda function has access to the relevant file using IAM, grabs it and returns it as a PDF binary in the response.

2 Likes

Hi @Mark-Hayward - Thanks. Is it possible to share the skeleton of the code ( to ensure no PII and PCI info are revealed) and in lambda, are you using boto3 library?

Please give some more details on the solution so that it will help all of us.

Regards - San

1 Like

Hi @Thomas : Thanks again for sharing detailed information on this. I tried the procedure but was getting ‘Access Denied’ error for a while. Then on checking with AWS team, we got to know that ‘Custom Visual Content’ can access only public S3 buckets but not private (at this moment). Since our S3 buckets are not public, do we have any alternative way to achieve this?

Hi @MadhuB,
I already briefly touched on this question above (see here). Can you please let me know on which aspect of the answer you need more details/guidance?

@Thomas : Apologizes. i overlooked that part… thanks for pointing out.

Hi @MadhuB
i am stuck in a similar obstacle. Were you able to get it working with AWS lambda for authentication and preview the file (private S3 bucket) in quicksight dashboard ?
Any guidance on this is appreciated