How should we print hundreds of rows and receipts in a PDF?

Hi Bubblers,

For those of you who have print-intensive features in your apps, what plugin or method are you currently using?

Within my knowledge, there are plugins like the famous PDF Conjurer by @vini_brito and some other plugins that enable you to print specific groups or pages like Zeroqode’s Page to PDF converter

We’re aiming to print 2 things:

  • A PDF with a structured dynamic table that could reach hundreds of rows. This will be for business inventory purposes (Any bond paper size will do)
  • Long receipts without page breaks - similar to the receipts we get when we buy groceries. (A thermal paper will be used)

We’ve tried zeroqode’s page to PDF converter but it doesn’t fit our use case with the page breaks and all. Furthermore, we also had issues with the scaling.

We haven’t tried the PDF conjurer plugin yet but I assume it won’t fit our use case, especially if we were to keep workload units in mind since if we were to initiate the PDF creation workflow using the plugin, it would need to search for the data in the DB and perform calculations in each row.

Also, if you were to create a table in the plugin’s actions, you would also need to search for the data type’s field in every column - further incurring us workload units.

We fear that it might timeout since there have been a lot of cases where the PDF conjurer timed out due to the immense data being queried or calculations being performed.

We could, however, probably get away with the query part if we were to load the data in a repeating group first, but there’s till the calculation issue - how would we be sure that the plugin won’t time out?


As for the second print structure (receipt), the plugins or even word has a max size for the document. How should we go about printing something that doesn’t have a page break and could extend infinitely?

I just saw this forum topic and it’s pretty interesting.

It converts HTML to PDF. I could see this working for our first use case (dynamic tables) but not the receipt use case since MS Word has a limited length size for the documents.

Would greatly appreciate if someone could point us to the right direction :pray:

1 Like

Check out docmaker, it wouldn’t solve your second issue of no page breaks (that I know of), but you can create tables in docx files that can loop through long lists of data. @elian may be able to provide some more insight for you. I’ve used it to create some very long documents before. docMaker (dM) Create beautiful pdf Plugin | Bubble

3 Likes

Hi guys! Wanted to share an update.

We tested out this method and it works like a charm :heart_eyes:

With this method, you won’t need to pay for third-party printing services since you’d simply be using an HTML format. You would, however, need to pay for the plugin which is much more cheaper than subscribing to a third party service, only to have a maximum number of API requests / documents.

What we’re having trouble now though is to print documents without page breaks and with dynamic length. This will be used for our receipts.

If you guys know a way or know a plugin that could do this, I’d greatly appreciate your help. We’re also willing to pay if you could teach us how to do it or probably build a plugin for this specific feature :grinning_face_with_smiling_eyes:

Would greatly appreciate anyone’s help :pray:

Hi!! Lola here. Glad to see that my pay it forward helped you. Im in the exact same boat with you on the invoice printing and thermal printing. Please share any workarounds you find.

Thank you!!

1 Like

Not specifying the paper format may get rid of page breaks but it doesn’t guarantee the paper size and the elements.

Yeah, that is why I couldn’t use that plugin too.

I wonder if @BrianHenderson has any input into how they print receipts for his POS

1 Like

Thanks for tagging @boston85719

Yeah, I saw his famous topic

And if I remember correctly, he mentioned that you need third party platforms to make a “connection” with the POS printer.

I tried out JS Print Manager like he suggested but for some reason, I can’t get to work. And by weird reason, I mean it doesn’t really open on my desktop. Will try it on other devices tho!

But yeah, I would greatly appreciate your insights on my issue @BrianHenderson :pray:

It does, as it is constrained by Bubble page’s size.

Exactly.

Since we print 57.5 mm or 2.265748 inches documents (receipts), if we were to use your plugin, we would need to have a fixed 217.51180799999997 px width for our page / group.

We want still want it be responsive :smiley:

So we’re ultimately looking a way where we could just create a template and attach dynamic data to it - similar to Print Pro

Unfortunately, Print Pro doesn’t enable us to create a custom size for the document.

That’s the conceptual ”problem”.
It is a bit like expecting a book to be responsive to the table it sits.

If you want to have a PDF to fit in a page size requirement with clearly defined pages, you must have a template adhering to the page ratio you want as output (either directly as Bubble page or sending data that will be inserted in said template).

No plugins will ever do magic by exporting a crafted PDF to be used in a printer directly from a webpage which is built first and foremost to be displayed on multiple devices, except applying the methods I mentioned above.

I known people don’t want to hear that, but that’s the harsh reality.

Yes, exactly. This is what I’ve been trying to say :sweat_smile:

The reason we made our first use case work was because we had a template. We converted a word document to HTML and simply added dynamic data.

I’m not looking for a page to PDF converter.

What I said here was purely hypothetical assuming we were to use your plugin.

I’m happy to chime in about printing to receipt paper.

If you’re pursuing a purely API solution and controlling the hardware remotely through the cloud is acceptable then PrintNode is easy to work with and well documented. There’s even a plugin if you don’t want to build out the API connections yourself. You can get running very quickly this way. I recall the price being reasonable but it’s been about three years since I last investigated it deeply.

If, however, you want to maximize physical security and (for example) prevent the ability to remotely kick open a cash drawer when you’re not physically standing in front of the device, then only allowing those devices to be controlled locally through the computer they’re connected to becomes essential.

I like JSPrintManager by Neodynamic because I can use the Toolbox plugin to just run some JavaScript and send native ESC/POS commands to the receipt printer from the browser locally. The receipt printer language runs line by line and so you just feed it what it needs in a “run JavaScript” action step. The length of the receipt is irrelevant because it just runs as long as you need until you send a cut command. You do have to get savvy with dealing with ESC/POS, JavaScript, and hexadecimal values to make it all work, but the end result is a snappy and reliable product.

The licensing fee for JSPrintManager is very reasonable for what you get. We control receipt printers, cash drawers, label printers (using ZPL label printer commands), and weight scales (using serial communication) through it.

QZ Tray is another similar competing product but I personally found it hard to understand. I have a competitor who uses it though.

2 Likes

This is sage advice, thank you so much @BrianHenderson

Quick question. If we were to u se these third-party platforms, do they have an option to create a template there? So that we could simply choose a template, send data, and it’ll print accordingly?

Or should we really still create PDFs first, and send that PDF to the third-party platform?

It’s my pleasure! That’s a great question and I don’t know the answer. I don’t do much with PDFs at the moment. However, the documentation for each of these products probably has answers for you.

So for Wash-Dry-Fold POS, were you just sending dynamic data to a pre defined template? What was the process behind your printing of receipts via JSPrintManager?

Right, dynamic data in an action step that is a block of JavaScript code that I wrote. I suppose you could call that a template. Every receipt needs the same header, footer, and general layout but you use dynamic data to populate the store name, date, cashier name, order #, line items, grand total and payment method along with any additional order notes.

1 Like