{"id":37020276,"url":"https://github.com/vxel/brotherql","last_synced_at":"2026-01-14T02:17:10.907Z","repository":{"id":278699249,"uuid":"936276630","full_name":"vxel/brotherql","owner":"vxel","description":"Java library for printing labels on Brother QL series label printers","archived":false,"fork":false,"pushed_at":"2025-10-17T06:50:59.000Z","size":1472,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-17T21:01:55.552Z","etag":null,"topics":["brother-label-printer","brother-ql","java","printing","usb-devices"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vxel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-20T20:18:59.000Z","updated_at":"2025-10-17T06:51:02.000Z","dependencies_parsed_at":"2025-02-21T08:19:47.610Z","dependency_job_id":"0ae9bdea-0464-453a-9cf5-0ba870f6c63d","html_url":"https://github.com/vxel/brotherql","commit_stats":null,"previous_names":["vxel/brotherql"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/vxel/brotherql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxel%2Fbrotherql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxel%2Fbrotherql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxel%2Fbrotherql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxel%2Fbrotherql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vxel","download_url":"https://codeload.github.com/vxel/brotherql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vxel%2Fbrotherql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brother-label-printer","brother-ql","java","printing","usb-devices"],"created_at":"2026-01-14T02:17:10.158Z","updated_at":"2026-01-14T02:17:10.893Z","avatar_url":"https://github.com/vxel.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java library for printing labels using the raster language protocol on Brother QL printers\n\nA Java library for printing labels on Brother QL series label printers.\n\nThis package implements the raster language protocol and allows you to control these printers\nand receive status (for USB printers only).\nNo printer driver is required since this package communicates directly with the label printer.\nIt allows to bypass difficulties encountered by many drivers and generic printing API\nto set the page sizes and margins, in particular for endless labels.\n   \nThe following printers should be supported: QL-500, QL-550, QL-560, QL-570, QL-580N, QL-600, QL-650TD, \nQL-700, QL-700M, QL-710W, QL-720NW, QL-800, QL-810W, QL-820NWB, QL-1050, QL-1060N, QL-1100, QL-1110NWB, QL-1115NWB.\nExperimental support is provided for PT-P900, PT-P900W, PT-P950NW and PT-P910BT.\n                     \nThe code has been developed and tested on Brother QL-700, QL-820NWB and QL-720NW.\nPlease report if you successfully tested the library with another printer, or if you encountered any problem.\n\nOptions supported (see BrotherQLJob javadoc for more details):\n- **autocut**: whether to automatically cut the label (default is true)\n- **halfcut**: whether to cut the label's backing without cutting the tape (support only for PT models, default is false)\n- **cutEach**: the number of labels after which a cut is applied (default is 1)\n- **feedAmount**: the feed amount. Note that in case of using QL-550/560/570/580N/700, 35 dots is always used, and 0 for Die-cut labels.\n- **delay**: delay in millis between prints\n- **dither**: whether to apply a Floyd-Steinberg dithering during conversion to black/red and white (default is true)\n- **threshold**: the threshold value (between 0 and 1) to discriminate between black/red and white pixels, based on pixel luminance. \n  Lower threshold means less printed dots, i.e. a brighter image. \n  Meaningless if dither is true\n- **brightness**: Brightness factor applied before dithering. Higher means brighter.\n- **rotate**: rotate the image (clock-wise) by this angle in degrees. Accepted angles are multiple of 90 degrees (90, 180, 270).\n- **dpi600**: use 600 dpi height x 300 dpi wide resolution. Only available on some models. The image must be provided as 600x600 dpi. The width will be resized to 300dpi.\n- **media**: the label size and type. Required only for network printer. Automatically detected for USB printers.\n\n## Note on two-color printing\n\nRed and black printing is supported by only a few models. It is activated when the printer and the media supports it. \nExample: model QL-820NWB and media CT_62_720_BLACK_RED. \n\nColor processing is performed this way :\n- alpha channel is first removed by blending transparent pixels to a white background. Brightness factor is applied. \n- next, red colors are extracted in a specific \"red\" layer, other colors are left in the default \"black\" layer. \n  Red colors are all colors belonging to the gradient from white (#FFFFFF) to pure red (#FF0000), with a small color tolerance.\n- each layer is applied a dithering or threshold processing, according to the job options. \n  The dithering of the black layer is done with a black and white color palette,\n  while the dithering of the red layer is done with a red and white color palette.\n- finally, the red layer is merged into the black layer.\n\nThis processing provides better results than a single Floyd-Steingberg dithering with a 3-color palette (black, red, and white).\nOf course, you can bypass it if you directly provide an already processed image containing only black (0x000000), \nred (0xFF0000) and white (0xFFFFFF) pixels, and use the default (0.5) threshold.\n\nHere is an example of dithering to red-black color.\n\nOriginal image (with transparent background) : \n\n  \u003cimg alt=\"Original image\" width=\"696\" height=\"373\" src=\"src/test/resources/test-image.png\"/\u003e\n\nImage dithered ready for 2-color printing :\n\n  \u003cimg alt=\"Rastered image\" width=\"696\" height=\"373\" src=\"src/test/resources/test-image-dither-rb.png\"/\u003e\n\n## Maven dependency\n\nThe package is available from [Maven Central](https://central.sonatype.com) and\ncan be used with the following dependency :\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.delaunois\u003c/groupId\u003e\n    \u003cartifactId\u003ebrotherql\u003c/artifactId\u003e\n    \u003cversion\u003e1.5.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Code example\n\nHere is a quick example of how to print a label using the library:\n```\n    // Create or load one or more images\n    BufferedImage image = ...;\n    \n    // Create a print job\n    BrotherQLJob job = new BrotherQLJob()\n            .setAutocut(true)\n            .setDither(true)\n            .setDelay(1000)\n            .setImages(List.of(image));\n\n    // Required only for Network printers.\n    // For USB printers, the media is automatically detected and given by the printer status.\n    job.setMedia(BrotherQLMedia.CT_62_720);\n    \n    // Print the job, using the first detected USB Brother printer\n    // For a network printer, use: new BrotherQLConnection(\"tcp://host:port/model\")\n    BrotherQLConnection connection = new BrotherQLConnection();\n    try (connection) {\n        // Open the connection with the printer\n        connection.open();\n        \n        // Check the printer state (optional)\n        BrotherQLStatus status = connection.requestDeviceStatus();\n        if (status.getStatusType() != BrotherQLStatusType.READY) {\n            // Printer is not ready !\n            return;\n        }\n            \n        // Note : this checks the printer state before printing\n        connection.sendJob(job, (pageNumber, s) -\u003e {\n            // Called when a page is printed.\n            // Return true to continue with next page, false otherwise\n            return true;\n        });\n        \n    } catch (BrotherQLException e) {\n        // Error while printing, See e.getMessage()\n        ...        \n    }\n```\n        \nThe list of available USB printers can be obtained through a call to `BrotherQLConnection.listDevices()`,\nthat will return a list of printer identifier like `usb://Brother/QL-700?serial=XXXX`, where `QL-700` is the name\nof a model (see `BrotherQLModel` enum class), and `?serial=XXXX` is optional and can be used to define the serial number\nof the printer to use.\nThe identifier is to be used as parameter of the `BrotherQLConnection` constructor.\n\nFor network printers, use an identifier like `tcp://localhost:9100/QL-720NW`, where `localhost` is the IP address \nor hostname of the printer, `9100` is the port (`9100` is the default port), and `QL-720NW` is the name of \nthe printer model (see `BrotherQLModel` enum class).\n\nFor debugging purposes, one can print into a file using an identifier like \n`file:///absolute/path/to/file.bin?model=QL-820NWB` or `file:relative.bin?model=QL-700`. Default model is QL-500.\nThe binary file can next be sent directly to the printer using e.g. `netcat` : \n```\ncat file.bin | nc -q 0 localhost 9100\n``` \n\n## Linux UDEV Configuration\n\nPlease note that the package needs Read/Write access to USB printer devices.\nIt might be needed to add specific UDEV rules to add these rights.\n\nExample :\n\n1. Create a new udev rule file :\n```\nsudo vi /etc/udev/rules.d/50-brotherusb.rules\n```\n2. Write in this new file the following rule (example) : \n```\nSUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"04f9\", MODE=\"0666\"`\n```\n3. Reload the rules :\n```\nsudo udevadm control --reload\n```\n\n## Author\n\nThis software package was written by Cédric de Launois based on Brother's documentation.\n\n## Acknowledgement\n\nThis package was made thanks to :\n- the [libusb library](https://libusb.info/) for the generic access to USB devices\n- the [usb4java](http://usb4java.org/) library to access USB devices with Java\n- the [Brother QL printers documentation](https://download.brother.com/welcome/docp000678/cv_qlseries_eng_raster_600.pdf)\n- the [brother_ql](https://github.com/pklaus/brother_ql) package that implements the same protocol for the Python language\n               \nWhite dove test image is from Mali Maeder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvxel%2Fbrotherql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvxel%2Fbrotherql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvxel%2Fbrotherql/lists"}