Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom label sizes #4

Open
robertmain opened this issue Jun 14, 2021 · 3 comments
Open

Allow custom label sizes #4

robertmain opened this issue Jun 14, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@robertmain
Copy link
Owner

Label sizes are currently hard coded in the software. This should be configurable via environment variables.

@robertmain robertmain created this issue from a note in Label Manager (To do) Jun 14, 2021
@robertmain robertmain added enhancement New feature or request good first issue Good for newcomers labels Jun 14, 2021
@robertmain robertmain moved this from To do to In progress in Label Manager Jun 15, 2021
@robertmain robertmain self-assigned this Jun 15, 2021
@robertmain robertmain added this to the MVP milestone Jun 15, 2021
@robertmain robertmain moved this from In progress to To do in Label Manager Jun 15, 2021
@robertmain
Copy link
Owner Author

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.

@crablab
Copy link
Collaborator

crablab commented Jun 16, 2021

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

@robertmain
Copy link
Owner Author

robertmain commented Jun 16, 2021

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

@robertmain robertmain removed this from the MVP milestone Jun 19, 2021
@robertmain robertmain added the help wanted Extra attention is needed label Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Development

No branches or pull requests

2 participants