Skip to content

tomcatliu2016/jsbarcode-spreadsheet-connector

Repository files navigation

Google SpreadSheet Barcode Generator

日本語      中文
Google SpreadSheet is a highly practical online spreadsheet system.
However, it lacks sufficient support for barcode generation; currently, the only method available online is simple barcode generation using the Libre Barcode font.
This method does not produce ideal barcodes, such as EAN/JAN codes, and does not support a comprehensive range of formats. To support a wider array of barcode formats, I utilized a mature js library - JsBarcode.
Using the underlying functionality of JsBarcode to generate barcode data, I used Google SpreadSheet's Sparkline function to draw the barcode graphics. This drawing approach was inspired by this repository.
However, due to the limited drawing capabilities of the Sparkline function, it cannot draw text, variable line lengths, etc., which is a drawback.

Also, this library utilizes clasp for local development of GAS (Google Apps Script). For more details, see the related documentation.

Basic Usage Process:

1. Clone the code

git clone https://github.com/tomcatliu2016/jsbarcode-spreadsheet-connector

2. Install dependencies

cd jsbarcode-spreadsheet-connector && npm install

3. Log in with clasp

clasp login

4. Create a GAS project or set an existing project's Script ID to .clasp.json

clasp create --type sheets --title "JsBarcodeSpreadSheetConnector" --rootDir ./dist

5. build locally

npm run build

6. Push the code to GAS server

clasp push

7. Complete the compile and push steps at once

npm run deploy

8. Open the Google SpreadSheet and use the custom function

clasp open

9. Use the custom function in the Google SpreadSheet

=sparkline(EAN13(A1), BarcodeOpt())

Sample Image

[As Shown]

About

バーコード生成、JANバーコード

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published