Exporting custom bricks visual as pdf
Hi,
I've created a carbon offset infographic using the blank custom brick which is embedded into our customer portal. I wish to allow our customer select the desired month and download the infographic as PDF in proper format (i.e., without month picker).
I used html2pdf module from cdnjs.cloudflare.com but encountered the following error upon clicking the export button: [Report Only] Refused to frame <censored> because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' *.domo.com sensorflow-org.domo.com".
Anyone knows how do I resolve this issue?
Best Answers
-
Perhaps this might help..
<!DOCTYPE html> <html>
<head>
<title>PDF Generation Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script>
</head>
<body> <!-- Your infographic content here --> <div id="infographic">
<h1>My Carbon Offset Infographic</h1>
<p>This is where your infographic content goes.</p>
</div> <!-- Button to trigger PDF generation --> <button id="downloadPDF">Download PDF</button> <script>
document.getElementById('downloadPDF').addEventListener('click', function() {
// Create a new jsPDF instance
var doc = new jsPDF();
// Add your infographic content to the PDF
var infographicContent = document.getElementById('infographic').innerHTML;
doc.text(infographicContent, 10, 10);
// Save the PDF
doc.save('carbon_offset_infographic.pdf');
});
</script> </body>
</html>** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Also add the cloudflare url to your Custom Apps authorized domains. If you want it to be approved outside of the Domo domain.
** Was this post helpful? Click 💡/💖/👍/😊 below. **
** If it solved your problem. Accept it as a solution! ✔️ **
Or do you need more help? https://calendly.com/matthew-kastner/15-minute-chat
Did I help you out? Feedback is priceless and will help me more than you know.Write a review!0
Answers
-
That appears to be a Content Security Policy issue….restricts the resources a web page can load based on domain policy. As if your frame (Domo portal) violates the security by attempting to frame another domain.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Perhaps this might help..
<!DOCTYPE html> <html>
<head>
<title>PDF Generation Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.4.0/jspdf.umd.min.js"></script>
</head>
<body> <!-- Your infographic content here --> <div id="infographic">
<h1>My Carbon Offset Infographic</h1>
<p>This is where your infographic content goes.</p>
</div> <!-- Button to trigger PDF generation --> <button id="downloadPDF">Download PDF</button> <script>
document.getElementById('downloadPDF').addEventListener('click', function() {
// Create a new jsPDF instance
var doc = new jsPDF();
// Add your infographic content to the PDF
var infographicContent = document.getElementById('infographic').innerHTML;
doc.text(infographicContent, 10, 10);
// Save the PDF
doc.save('carbon_offset_infographic.pdf');
});
</script> </body>
</html>** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Also add the cloudflare url to your Custom Apps authorized domains. If you want it to be approved outside of the Domo domain.
** Was this post helpful? Click 💡/💖/👍/😊 below. **
** If it solved your problem. Accept it as a solution! ✔️ **
Or do you need more help? https://calendly.com/matthew-kastner/15-minute-chat
Did I help you out? Feedback is priceless and will help me more than you know.Write a review!0
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.4K Charting
- 709 Beast Mode
- 49 App Studio
- 39 Variables
- 667 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 44 Workflows
- 7 DomoAI
- 33 Predict
- 13 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 115 Manage
- 112 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 103 Community Announcements
- 4.8K Archive