-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Label Engine #12050
New Label Engine #12050
Conversation
Hi there - thanks for this! This is a pretty big PR - can you include some screenshots, etc? |
My inclination for revamping labels was actually going to be javascript-based, not PDF based, so people could change things on the fly and see how they'd look. That said, I'm curious to check out what you've done here. |
Hi! Yeah, I tried a few options with JS and CSS but found the results when printing were inconsistent between printers and even between Chrome's print page and the system dialog. That's why I went with PDF, as we can set the exact page size and it will always print just so. That means it worked with label sheets (I tested on Avery L7162), and also on tape labels (Brother P-Touch tze 24mm). Your idea of an instant preview is awesome. I'll see if I can get something like that working somehow. I'll get some screenshots and photos together and attach them here. |
Each example below shows the Labels settings page, the assets included, the output from clicking Generate Label, and the output from selecting multiple on the assets index page and choosing Generate Labels from the bulk actions. New Engine Disabled - Settings PageNew Engine Enabled - DefaultLabel SelectedNew Engine Enabled - Custom Template SelectedTest Prints |
The option for 2D Barcode Target allows the QR code URL to include the asset tag so we can use a portable scanner for quick identification. The new /ht/{asset_tag} route is a shorter version of /hardware/byTag/{asset_tag}, to allow for smaller QR codes. |
Looks good. But, can we add specific common fields to the label. *Company*,
*Location*, *Asset Tag, Serial* and *Person (First & Last Name)* (IF ITEM
IS CHECKED OUT). This would be very useful for creating student chromebook
labels.
…On Tue, Nov 1, 2022 at 9:18 PM cram42 ***@***.***> wrote:
New example using 24mm P-touch label tape
[image: P-touch Labels]
<https://user-images.githubusercontent.com/5396871/199379803-0abc56c7-08ef-4ec1-b4ce-1898afa29b12.png>
—
Reply to this email directly, view it on GitHub
<#12050 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2FP6U6KWYNABNC4HMMBGR3WGHFP3ANCNFSM6AAAAAARUALIBY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Edit: Just realised you wanted First Name and Last Name. Currently, they're separate fields, but I'll have a look at building a definition for concatenation. Sure can. Currently, it's not super user-friendly. But, I just set the Fields Definition to |
This kind blew up Codacy for code quality :-/ We probably want to refactor this a bit. |
I might have to back this change out at least until we handle these issues :( |
So I think the reason the preview full screen page is blank is because I can't get the list to load, so it can't preview anything. :-/. I think we need to figure out the TCFPDF_STATIC issue first. |
Okay, I've fixed the composer conflicts and issues. Still seeing an issue with the rendering if assets are selected that don't belong to a company, since the method in I'm also not really in love with creating a new directory ( |
Also possibly related, though it might be an asset tag compatibility issue: #13472 |
@cram42 this may be a very stupid question, but I'm not sure how to add a new label template. I added a directory within the |
Never mind, I think I've got it |
@snipe |
I have a missing some options which would be useful for use, like:
|
Renaming wouldn't make sense, since they are specific to the labels themselves.
Not sure I understand. You can already select the template before printing.
Probably not feasible, as there are a ton of fields across assets, models, categories, etc. Would be a UI nightmare. |
If you mean about select template in Labels setting, please bear in mind not all users have access, only admin, so if some user would like to generate labels from assets is not able select template to use (shets/tapes) |
First of all, thanks for the great job! I'm a simple user but...how can we find the internal id from, for example, a custom field? Thanks a lot! |
I am trying to create my own Labels\Tapes\Brother setup but I am having issues trying to understand how to change the const to match what I need. @cram42 I am remarkably close but for some reason I have a larger space at the bottom of the tag that I just can figure out where I have gone wrong. The Tape i am using is DK-2211 and i selected 29mm x 45mm as the size for the setup. |
Figured it out. I had removed the tag from below the QR code and put in the right column but some other place holder is holding that space. |
@snipe |
Sorry all for the absence. My grandfather's had a stroke so I've been at the hospital all day every day.
Yep, I get the feeling there may be a minimum QR size. Will check it out now.
Under custom fields, you can enable the "DB Field" column.
I think it's to do with the barcode content vs code format. I'm going to spin up a dev instance here at the hospital and see if I can get some stuff sorted while gramps sleeps. |
@asuman1179 can you share with the class how you created your own label template? It would be very nice to tweak the existing Brother 24mm template to include both a 1D and 2D barcode. |
I think will be great to add some option for create own template by "Save as" ;) |
You'd probably have to try |
Try adding data source like: |
really silly question, should Assigned To be showing who it is Checked Out to? Ours have users checked out but showing nothing for assigned to when generating labels |
Description
Full custom PDF label support. Allows single page labels (for tape printers) or rectangles-on-a-page sheets (for label sticker paper). Renders to PDF using TCPDF.
Labels are defined as class files within
App\Models\Labels
, extending theLabel
abstract class. These define unit of measure, size, and feature support.Helper functions are in place to make placing text, images, and barcodes easy.
Helper abstract classes are in place to allow multiple labels per page.
API endpoints have been created to find Label templates installed.
A custom (read: hacky) label
DefaultLabel
has been created to simulate the legacy label generator. When selected, all legacy settings remain available.Type of change
How Has This Been Tested?
Tested in my browser, as I don't know how to run the included test units (missing testing database).
Test Configuration:
Checklist: