flowcore-io / luttaka-open

The open source event experience app powered by the Flowcore Data Management Platform
https://luttaka.com
MIT License
11 stars 11 forks source link

added some code but it's not working yet #160

Closed odinellefsen closed 2 months ago

odinellefsen commented 2 months ago

I am having difficulty defining xml in the correct format

hediinn commented 2 months ago

from the doc's pf dymo.lable.framework

{string} dymo.label.framework.createLabelWriterPrintParamsXml(params) Creates an XML string suitable to to pass to the [dymo.label.framework.printLabel](file:///home/hedint/Projects/dymo-connect-framework/doc/JavaScript/DYMOLabelFrameworkDocumentation/symbols/dymo.label.framework.html#.printLabel) function as printParamsXml parameter. Created print parameters are for printing to LabelWriter printers. Returns an XML string. Parameters: {object} params A JavaScript object with the following properties (not all properties must be defined; if a property is not defined, a default value is used): params.copies - The number of copies to print. params.jobTitle - The print job title/description. params.flowDirection - The direction of the label content on the label (left-to-right or right-to-left). Use the [dymo.label.framework.FlowDirection](file:///home/hedint/Projects/dymo-connect-framework/doc/JavaScript/DYMOLabelFrameworkDocumentation/symbols/dymo.label.framework.html#.FlowDirection) enumeration to specify the value. params.printQuality - The print quality. Use the [dymo.label.framework.LabelWriterPrintQuality](file:///home/hedint/Projects/dymo-connect-framework/doc/JavaScript/DYMOLabelFrameworkDocumentation/symbols/dymo.label.framework.html#.LabelWriterPrintQuality) enumeration to specify the value. params.twinTurboRoll - The roll to print to if the printer is a TwinTurbo printer. Use the [dymo.label.framework.TwinTurboRoll](dymo.label.framework.html#.TwinTurboRoll) enumeration to specify the value. Returns: {string} {dymo.label.framework.ILabel} dymo.label.framework.openLabelXml(labelXml) Loads label content from an XML stream/string. Note: This is the preferred way to load/open label files. Use XMLHttpRequest() or other standard browser methods to get XML string. Returns Label object. Parameters: {string} labelXml The label definition as an XML string. Returns: {dymo.label.framework.ILabel} {[dymo.label.framework.ILabel](dymo.label.framework.ILabel.html)} dymo.label.framework.openLabelFile(fileName) Loads label content from a file or URL. The following considerations should be taken before using this function: The full file name or URL should be specified. The function will not honor relative paths based on document.location.href. The fileName can be an http:// or file:// URL. On Windows the file name can be a regular file name, for example 'c:\users\desktop\address.label'. The content of the label will be loaded synchronously. Therefore, if the remote server is down there will be a timeout. Any local file can be accessed or attempted to be accessed. The function is not limited by any browser restrictions. However, only a valid label file (according to label.xsd schema) can be loaded. This could still be a potential security concern. The URL is not limited to same-site-origin browser policy. Any URL can be opened. The proxy settings are the system default settings, these are not necessarily the browser settings. Use this function only when there is no other way to load label data. In most cases, label data should be loaded using [dymo.label.framework.openLabelXml](file:///home/hedint/Projects/dymo-connect-framework/doc/JavaScript/DYMOLabelFrameworkDocumentation/symbols/dymo.label.framework.html#.openLabelXml). Parameters: {string} fileName FileName or URL to load label from. Returns Label object; provides label manipulation methods. Returns: {[dymo.label.framework.ILabel](file:///home/hedint/Projects/dymo-connect-framework/doc/JavaScript/DYMOLabelFrameworkDocumentation/symbols/dymo.label.framework.ILabel.html)} dymo.label.framework.printLabel(printerName, printParamsXml, labelXml, labelSetXml) Prints one or more labels. Parameters: {string} printerName The name of the printer to print to. A list of printers can be obtained using dymo.label.framework.getPrinters. {string} printParamsXml The print parameters, such as number of copies, print quality, etc. See [PrintParams.xsd](http://labelwriter.com/software/dls/sdk/PrintParams.xsd). {string} labelXml The label to print. {string} labelSetXml The LabelSet to print. LabelSet is used to print multiple labels with the same layout, but with different data, such as multiple addresses. Use [dymo.label.framework.LabelSetBuilder](file:///home/hedint/Projects/dymo-connect-framework/doc/JavaScript/DYMOLabelFrameworkDocumentation/symbols/dymo.label.framework.LabelSetBuilder.html) class to create a LabelSet, or construct XML manualy according to [LabelSet.xsd](http://labelwriter.com/software/dls/sdk/LabelSet.xsd).
hediinn commented 2 months ago

extra:

{string} dymo.label.framework.LabelSetBuilder.toXml(records) Converts record objects to XML format. The XML format schema is defined in LabelSet.xsd. Returned XML can be passed to dymo.label.framefork.printLabel as labelSetXml parameter. This function can be used independent of other LabelSetBuilder methods, if records data is generated by other functions. Parameters: {Array} records The records to convert to XML. Records should be an array-like object of associative-arrays with object names as keys and object text as values. Returns: {string} An XML string.