QuickSight Export To PDF functionality for generate_embed_url_for_anonymous_user Function

Hello. First post here and looking for some insights on how to meet my requirements.

We have some dashboards that we expose as an embeddable URL via the boto3 function:
generate_embed_url_for_anonymous_user

To enable PDF exports of the dashboard as a feature on the embeddable URL, I am trying to pass in the following configuration:

def getQuickSightDashboardUrl(dashboardId):
	try:
		quickSight = boto3.client('quicksight', region_name=AWS_REGION)
		dashboardArn='dashboardArnHere'

		logging.info("Generating embed URL for: %s", dashboardArn)
		response = quickSight.generate_embed_url_for_anonymous_user(
				AwsAccountId = AWS_ACCOUNT_ID,
				Namespace = 'default',
				ExperienceConfiguration = {
					'Dashboard':{
						'InitialDashboardId':dashboardId, 
					}
				},
				AuthorizedResourceArns = [dashboardArn],
				SessionLifetimeInMinutes = 60,
				Capabilities=['EXPORT_TO_PDF']
			)
		return response
	except ClientError as e:
		# TODO: Handle each specific exception thrown by generate_embed_url_for_anonymous_user because they're not all client errors
		logging.error(f'ClientSideError: could not generate embed url for: {dashboardArn}, Details: {e}')
		raise ClientSideError(e)
	except Exception as e:
		logging.error(f'ServerSideError: could not generate embed url for: {dashboardArn}, Details: {e}')
		raise ServerSideError()

I am unable to find any relevant documentation, hence, I am looking to try the configuration:
Capabilities=['EXPORT_TO_PDF']

If anyone can point to the specific documentation on the available options to enable PDF export, that will be certainly helpful.

What options should I pass in so that the functionality to export the dashboard will become available for the embeddable url?

Hi @AngeloCarbonCure - Iā€™m not sure if this limitation was resolved. Check out this thread. Generate pdf with printEnabled option not working - #21 by David_Wong

Thanks for the link, but I think the thread was mentioning more for the PDF option for registered users.

I need the option where the facility to export the whole dashboard as pdf would be enabled.

@AngeloCarbonCure ,

1/ You can export to pdf for anonymous only if row level security is not enabled.
2/ The export to pdf is to be enabled using the amazon-quicksight-embedding-sdk - npm [ Search toolbarOptions ] .
3/ The boto3 is used the generate the embed url.

1 Like

I took a look at the example implementation of the QuickSight dashboard in this resource.

In the How To Customize It tab, there are options you can turn on, with one of them the Print settings. Once you click on it, it sets the configuration:

const contentOptions = {
	toolbarOptions: {
		export: true,
	},
};

Which I believe is the one you refer to.

The only thing I see once you enable that option is the Export icon button that appears on the top right of the dashboard, and once you click on it, it displays a panel where you are supposed to find the PDF, CSV and Excel file exports. But I am not seeing any functionality where you can have the whole dashboard exported to PDF.

I am unsure if I am missing something in here where the dashboard can then get exported fully to PDF (i.e. a button present on the embedded dashboard) and that side panel will contain the PDF as it has been exported.