How to Generate a PDF #7278
Replies: 3 comments 9 replies
-
Hi @R2bEEaton, the Import doesn't work for me❓ |
Beta Was this translation helpful? Give feedback.
-
Okay, you might need to upload and download the html2pdf file to the
database yourself and re-link it yourself by modifying the html2pdf embed
in the component tree.
[See @melohagan's comment.](#7278 (comment))
…On Tue, Aug 16, 2022 at 8:56 AM Kevin ***@***.***> wrote:
Chrome &
[image: image]
<https://user-images.githubusercontent.com/95284278/184884854-c6693e9c-58a0-4426-b544-709a12e1dea1.png>
—
Reply to this email directly, view it on GitHub
<#7278 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKNYIRJRF62YAQJYXAQ3RTVZOFXFANCNFSM56SRMBHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
This is very nice - great job! 👍 File attachments are stored on your own MinIO instance, therefore to get this to work you will need to replace the file attachment. Step 1 - Upload html2pdfOpen this link in your browser: https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js Edit the jsfile table row. Remove the existing attachment and upload the downloaded minified js. Step 2 - Update the import embedClick on the JS file to open the attachment in a new browser tab. Copy the URL from Replace the addScript URL in the import embed: Result |
Beta Was this translation helpful? Give feedback.
-
This is unbelievably hacky. Hopefully we get official support soon. HUGE downside is you can't select any text in the PDF. You effectively have taken a screenshot of a part of the page downloaded as a PDF.
Here is a brief explanation of how this works. Comment or check the included export if you have any questions.
dist/html2pdf.bundle.min.js
and upload it to a table in Budibase with an attachment field. Then get the URL of the file by right clicking on the preview on the table and copying the link. Uploading the script to a Budibase table is to get around an untrusted script source problem later on.container1
to whatever you named your container. All of this code below is necessary to include Budibase CSS when only converting a single container to PDF. If you want to do the whole page, it would be as simple as doingonclick="html2pdf(document);"
.The PDF generation will take 5-10 seconds and even longer for the whole document, but it should start downloading automatically. You should probably display some waiting animation while it creates the PDF.
Here is the export. Please consult this if you have any confusion on how to implement the steps above.
PDF Hack-export-1660576133844.txt
The export was made on v1.2.20 and tested on Microsoft Edge.
Beta Was this translation helpful? Give feedback.
All reactions