Create (draw) barcode image from array in google doc using google script -
I have to generate and paste the barcode image into Google Docs. I have come to know how to create a JS array, which displays it, using Google Script. But it is not known how to create and paste an image from a Google Doc with this array, although it is easy to create an SVG image in a simple web page.
Can you help me?
If you can get something like the jQuery plugin to work with the new IFrame HTML service , You can make bar codes in HTML, then save the image to an image file. Then get the file as a blob.
If the new IFrame HTML service accepts a plugin, and allows a canvas tag, then it can work like this.
I do not know I have a way to code my own code to create a bar code, I think you want to see what's available on the Internet.
You are asking a very comprehensive question, for which to answer, there will be something like a tutorial.
The code to insert the image from the original poster:
function insertImage () {var baseUrl = canvas.toDataURL ("image / png"); Var resp = UrlFetchApp.fetch (baseUrl); Doc.getChild (0) .asParagraph () appendInlineImage (resp.getBlob ()). }; Basic Generic Function: function insertImage () {var Doc = DocumentApp.openById ('Your doctor's ID is here'); Var image = DocsList.getFileById ('Your Image ID Here'); // Use it if the doctor is open and the code is running, then this doctor is bound to // var body = DocumentApp.getActiveDocument (). GetBody (); Var body = Doc.getBody (); Var whatParagraph = 3; // Insert an image in the fourth paragraph body. Insert image (image); // 'Image' is an image file that is in the form of a blob /. Append image (what paragraph, image); // either insert or append can be used}
Comments
Post a Comment