How to combine image and text into one blob in google drive -
How to combine image and text into one blob in google drive -
i'm trying create own barcode labels google apps script. i'm able retrieve image blob of barcode, want able add together row of text it. possible combine or edit image blob? if how 1 go doing that.
here current code getting barcode.
function createlabel() { var url = "http://www.barcodesinc.com/generator/image.php?code=20-001-001&style=196&type=c128b&width=200&height=100&xres=1&font=3" var image = urlfetchapp.fetch(url).getblob(); driveapp.createfile(image); }
i know barcode comes number of info below it, need create number larger , easier read.
i've tried creating document , inserting text , image, it's printing need print.
google not offer image manipulation methods in apps script (yet). maybe when google draw supports apps script there can utilize programmatically insert image drawing , add together text it, have create own ad-hoc solution.
you did not specify final goal - sheet of same label, sheet of different labels, or single label displayed on screen user save/download. here ideas try:
create 1-page google document table in that, when printed fits labels. have tinker margins, table , cell dimensions, borders, etc create fit labels. doc template. script create re-create of doc, , insert barcode image(s) , text table cells. study google apps script drive service , google apps script document service reference methods can utilize in code this. if goal single label output screen user save/download, explore html5 canvas element and/or canvas- or svg-manipulating client javascript libraries drawing image on screen , adding text it. have not used these techniques much, can't recommend definitive resource, see this question starters. check out these js libraries: easeljs, html canvas javascript library , fabric.jsfinal note: barcode generator using - barcodesinc.com - allows generate barcodes without text and/or border. want labels - no point having code text twice on label.
google-apps-script google-drive-sdk
Comments
Post a Comment