minlux / dymon

Command line based print tool for DYMO LabelWriter Wireless.
MIT License
40 stars 10 forks source link

adding diferent lables. #3

Closed mullcom closed 3 years ago

mullcom commented 3 years ago

hello this is nice thing you have done here. the software are no avalibale for download so i found this.

install and all god. but when i make change to print.cpp i dont get any update on webbpage to chose the new lable.

//To get an idea how to change the label size/format have a look into src/print.cpp. There is an implementation for two different label formats with different orientation.//

My code static const LabelFormat_t m_LableFormat[NUM_LABEL_FORMATS] = { //Bitmap- Bitmap- Label- Barcode- Title- Body- //Orientation Width/Height Length Scale Font Font { Bitmap::Orientation::Horizontally, 272, 252, 25.4, 0.9, &FreeSans18pt7b, &FreeSans15pt7b }, //0: 25mm x 25mm Label { Bitmap::Orientation::Vertically, 400, 960, 88.9, 0.8, &FreeSans24pt7b, &FreeSans18pt7b }, //1: 35mm x 89mm Label { Bitmap::Orientation::Horizontally, 224, 602, 51, 0.7, &FreeSans24pt7b, &FreeSans18pt7b }, //2: 19mm x 51mm Label }; //Note: Width/Height are given as a pixels with 300dpi.

minlux commented 3 years ago

Hi, glad to hear, that you like my tool.

The way you added the new lable to the table in print.cpp is correct. Now you must also edit the HTML page to make the new label available as an select option. Therefore just add

<option value="2">19mm x 51mm</option>

at line 95 of www/index.html. However, dymon doesn't serve this file directly. Instead it is compiled into the binary. For this reason you must convert the modified index.html into a byte array and compile it into the code (see index_html.c). If you are using Linux, you can convert index.html into index_htm.c withe the following command (from within www folder):

xxd -i ./index.html > ../src/index_html.c

The just recompile with make.