What plugin are we really missing?

@jonah.deleseleuc

A plugin for the Safe Area on mobile. Capture the safe area insets and access those values for use in dynamic expressions.

@jonah.deleseleuc would love a plugin for apple wallet/google pay passes.

2 Likes

@jonah.deleseleuc , @bubble.trouble, are any of the options below possible?

@gerbertdelangen There is a problem with knowing when to create a page break. Because we can use the print function in Puppeteer this can be worked around flawlessly. However, when doing this purely in JS we have trouble with printing scrollable content.

Here is the purely JS solution using jsPDF. To run this in your own app using the toolbox → run javascript (I triggered the run javascript with a Button click). Edit: Content is no longer clipping but image is distorted… could be a solution here)

debugger;

const quality = 1 // Higher the better but larger file
html2canvas(document.querySelector('body'),
    { scale: quality }
).then(canvas => {
    const pdf = new jspdf.jsPDF('p', 'mm', 'a4');
    pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, 211, 298);
    pdf.save('test.pdf');
});

NOTE: In order for this to work you need to pull in the JS libraries from CDN. This can be done from the Settings → SEO / metatags page, but only on paid plans (why including script tags is behind a paywall is absolute foolishness #bubbledum)

<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
1 Like

@bubble.trouble, thanks for the clarification, will play around with it.

It seems pdfmake allows you to create templates and does mention " dynamically control page breaks, for instance to avoid orphan children". Maybe it is an alternative to solutions which require Puppeteer (e.g. external processing power which probably means monthly subscription fees).

Here it is guys. jsPDF actually will solve the problem for a lot of use cases (I think)!!

Let me know what you think. This works if you don’t need searchable text as it’s adding the page(s) as an image. If it’s too complicated to add to your project I’m sure we can add it into a plugin to make it simpler.

const quality = 1 // Higher the better but larger file
html2canvas(document.querySelector('body'),
    { scale: quality }
).then(canvas => {
const imgData = canvas.toDataURL('image/png');
    const pdf = new jspdf.jsPDF('p', 'pt',  [canvas.width, canvas.height]);

let width = pdf.internal.pageSize.getWidth();
let height = pdf.internal.pageSize.getHeight();

pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, width, height);
    pdf.save('test.pdf');
});
1 Like

There’s already a plug-in that does images as pdfs. It’s one of the things we’re trying to avoid as well

2 Likes

@jonah.deleseleuc

Any news?
Looking to revive this topic.

The plug-in team is overhauling the plug-in API. Could be possible with puppeteer soon

4 Likes

Definitely would like puppeteer. In the meantime I used the html2pdf library client side and this worked (with images aswell) but it does have some limitations in contrast with puppeteer.

Hi @jonah.deleseleuc - I was catching up on your thread that started last July. I am not sure if you are still looking for inspiration for new plugins… if you are here are a few suggestions below.

Vector Databases

  • Weaviate
  • Pinecone

Visualization

  • Highcharts
  • yFiles
  • Markmap

We’ve built a pretty good PDF maker with puppeteer on Heroku. We’ve had to take it down though as the server cost was getting quite high and our current focus is on other parts of our business.

PDF’s are of amazing quality. If you’re interested to buy/take this over, send me a message.

The PDF generator supports portrait/landscape/mobile/custom-size and also has much more useful options

p.s These are real PDF’s and not images

Let’s move it to a gcf :wink:

Pennie’s on the dollar!

We need a ChatGPT plugin that automatically generates a bubble app with full workflows, custom states, and api calls based off of a short prompt :slightly_smiling_face::+1:t4:

Bonus points if the plugin can also push the app to live, market it, start building a user base, figure out a revenue model, and then set up a stripe account that deposits the monies directly into our bank accounts.

Still fascinated that there isn’t a robust bulk option set plugin yet. There’s one out there, but it’s very limited.

Same, I offloaded some SSAs to GCF and all of them fly under the free tier :joy:

1 Like