Giter Club home page Giter Club logo

Comments (3)

robertmain avatar robertmain commented on June 19, 2024

Actually going to park this for now. To complete this ticket properly, we need to find a way to interpret the XML that the Dymo software spits out.

from moving-labels.

crablab avatar crablab commented on June 19, 2024

I might do this just for env file setting - is that good enough for now? You can do the Dymo stuff if you want, but I think that should also have some flag since (as in my case) the printers are not Dymo

from moving-labels.

robertmain avatar robertmain commented on June 19, 2024

You can do the Dymo stuff if you want, but I think that should also have some flag since (as in my case) the printers are not Dymo

I just understood what you meant by this, and I thought I should clarify. So, first, a bit of background...

If you want to build custom applications that talk to a Dymo label printer, their recommended way to do this is to install Dymo connect on your computer. This does two things.

  1. It gives you a WYSIWYG label editor
    image
  2. It spins up a web server that listens on a port range from 41951-41960. More info on that here on page 5.

The expectation then is that you use the WYSIWYG editor to generate some XML, which you then export and feed to your application to populate as it wishes. Your application should then POST this XML to http://localhost:<dymo port>/PrintLabel(not sure about that last path segment tbh).

The XML in question looks a little like this:

<?xml version="1.0" encoding="utf-8"?>
<DieCutLabel Version="8.0" Units="twips">
  <PaperOrientation>Landscape</PaperOrientation>
  <Id>LargeShipping</Id>
  <PaperName>30256 Shipping</PaperName>
  <DrawCommands>
    <RoundRectangle X="0" Y="0" Width="3331" Height="5715" Rx="270" Ry="270"/>
  </DrawCommands>
  <ObjectInfo>
    <TextObject>
      <Name>TEXT</Name>
      <ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>
      <BackColor Alpha="0" Red="255" Green="255" Blue="255"/>
      <LinkedObjectName></LinkedObjectName>
      <Rotation>Rotation0</Rotation>
      <IsMirrored>False</IsMirrored>
      <IsVariable>False</IsVariable>
      <HorizontalAlignment>Left</HorizontalAlignment>
      <VerticalAlignment>Middle</VerticalAlignment>
      <TextFitMode>AlwaysFit</TextFitMode>
      <UseFullFontHeight>True</UseFullFontHeight>
      <Verticalized>False</Verticalized>
      <StyledText>
        <Element>
          <String>T</String>
          <Attributes>
            <Font Family="Helvetica" Size="13" 
            	Bold="False" Italic="False" Underline="False" Strikeout="False"/>
            <ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>
          </Attributes>
        </Element>
        <Element>
          <String>EST123</String>
          <Attributes>
            <Font Family="Helvetica" Size="13" 
            	Bold="False" Italic="False" Underline="False" Strikeout="False"/>
            <ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>
          </Attributes>
        </Element>
      </StyledText>
    </TextObject>
    <Bounds X="335.9998" Y="57.6001" Width="5337.6" Height="3192"/>
  </ObjectInfo>
</DieCutLabel>

That was taken from the README of this npm package, which I originally tried to use, but sadly it depends on having Dymo connect running as it tries to print to the embedded web server. Since Dymo connect won't run on Linux, that's a bust, meaning we have to use CUPS + IPP instead.

Coming back to the XML though, it seems like it would make sense to standardize on something that this application understands and converts into commands to PDFKit. I picked the XML flavored XML simply because it's the first one that I came across and (one would assume) is fairly widely used. But, the actual make of printer being used is irrelevant as the XML is just used to tell the app how to lay the label out and what size it should be.

image

from moving-labels.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.