GithubHelp home page GithubHelp logo

Comments (4)

veghp avatar veghp commented on May 27, 2024

Can you please point to that part of documentation and also clarify what you mean? What format (Python object) do you have your table in?

There are examples in https://github.com/Edinburgh-Genome-Foundry/blabel/tree/master/examples for printing several items per page, reading from spreadsheet etc

from blabel.

rickbps avatar rickbps commented on May 27, 2024

Hello,

The documentation shows how to print two labels on one PDF as follows:

`from blabel import LabelWriter

label_writer = LabelWriter("item_template.html",
default_stylesheets=("style.css",))
records= [
dict(sample_id="s01", sample_name="Sample 1"),
dict(sample_id="s02", sample_name="Sample 2")
]

label_writer.write_labels(records, target='qrcode_and_label.pdf')`

My requirements are:

  • Users go to a PHP page that interacts with a MYSQL database.
  • On the page, they can filter a long list of items by ID number
  • They could, for example, end up with a group of 6 items that share a common ID number
  • Right now, my page has a button for each item that uses blabel to print a label for each item
  • What I would like to do is have one button that prints all six lables (or whatever the item count is) on one PDF

from blabel.

veghp avatar veghp commented on May 27, 2024

I see the problem now. The package is designed around a fixed PDF page or label size as that's how label printers (or printers in general) operate. But you have variable number of items, which means different PDF sizes. As I mentioned, it's possible to print several items per page, or see this example: #6

And here is an example for working from tables (spreadsheet / dataframe): https://github.com/Edinburgh-Genome-Foundry/blabel/tree/c95052f562af44ef47e2ec5b220ffbb3b721659b/examples/labels_from_spreadsheet

Alternatively you can work directly with WeasyPrint or PDF Reports.

from blabel.

rickbps avatar rickbps commented on May 27, 2024

The printing from table/label is closest to what I need, so maybe I can use that. Thank you.

from blabel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.