日本語 中文
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.
git clone https://github.com/tomcatliu2016/jsbarcode-spreadsheet-connector
cd jsbarcode-spreadsheet-connector && npm install
clasp login
clasp create --type sheets --title "JsBarcodeSpreadSheetConnector" --rootDir ./dist
npm run build
clasp push
npm run deploy
clasp open
=sparkline(EAN13(A1), BarcodeOpt())