8 Home
Mauricio Baeza edited this page 2019-11-22 03:45:06 +00:00

ZAZ BarCode

Extension for insert barcode in LibreOffice documents

Barcodes provided

  • code39
  • code128
  • ean
  • ean13
  • ean8
  • gs1
  • gtin
  • isbn
  • isbn10
  • isbn13
  • issn
  • jan
  • pzn
  • upc
  • upca
  • qrcode

Calc

image

Writer

image

Draw

image

Impress

image

By code

  • Python
import uno

CTX = uno.getComponentContext()
SM = CTX.getServiceManager()

def create_instance(name, with_context=False):
    if with_context:
        instance = SM.createInstanceWithContext(name, CTX)
    else:
        instance = SM.createInstance(name)
    return instance

def main():
    from com.sun.star.beans import NamedValue
    zaz = create_instance("net.elmau.zaz.BarCode")

    args = (
        NamedValue('Type', 'qrcode'),
        NamedValue('Data', 'libreoffice.org'),
    )
    path = zaz.execute(args)
    print(path)
    return
  • Using easymacro.py
import easymacro as app

def main():
    zaz = app.create_instance("net.elmau.zaz.BarCode")
    args = {
        'Type': 'qrcode',
        'Data': 'libreoffice.org',
    }
    args = app.dict_to_named(args)
    path = zaz.execute(args)
    print(path)
    return
  • Basic
Sub Main()
  
    Dim args(2) As New com.sun.star.beans.NamedValue
    zaz = createUnoService("net.elmau.zaz.BarCode")
  
    args(0).Name = "Type"
    args(0).Value = "qrcode"
    args(1).Name = "Data"
    args(1).Value = "libreoffice.org"
    path = zaz.execute(args)
    MsgBox path
  
  
    args(0).Name = "Type"
    args(0).Value = "qrcode"
    args(1).Name = "Data"
    args(1).Value = "libreoffice.org"
    args(2).Name = "Path"
    args(2).Value = "/home/mau/tmp.svg"

    zaz.execute(args)
  
End Sub