0

Javascript API を使用して、連続ラベルの XML を作成しようとしています (セル レイアウトを使用する必要があります)。

ここに私が持っているものがあります:

<ContinuousLabel Version="8.0" Units="twips">
<PaperOrientation>Portrait</PaperOrientation>
<Id>Continuous</Id>
<PaperName>30270 Continuous</PaperName>
<LengthMode>Auto</LengthMode>
<LabelLength>0</LabelLength>
<RootCell>
<Length>0</Length>
<LengthMode>Auto</LengthMode>
<SubcellsOrientation>Vertical</SubcellsOrientation>
<Subcells>
<Cell>
<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>Center</HorizontalAlignment>
<VerticalAlignment>Middle</VerticalAlignment>
<TextFitMode>ShrinkToFit</TextFitMode>
<UseFullFontHeight>True</UseFullFontHeight>
<Verticalized>False</Verticalized>
<StyledText>
<Element>
<String>Hello World</String>
<Attributes>
<Font Family="Lucida Grande" Size="13" Bold="False" Italic="False" Underline="False" Strikeout="False"/>
<ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>
</Attributes>
</Element>
</StyledText>
</TextObject>
<Length>0</Length>
<LengthMode>Auto</LengthMode>
</Cell>
</SubCells>
</RootCell>
</ContinuousLabel>

サブセル タグにセルを追加することはできますが、行と列を (ヘッダーとフッターと共に) 作成する必要があります。

彼らのドキュメントには、ルートセルにはセル(サブセル)が含まれており、セルにはラベルオブジェクトまたは他のサブセルを含めることができると書かれています(xmlに関する情報はほとんどありません).netフレームワークのドキュメントを見つけました。 .net) であり、それらの IContinuousLabelCell にはプロパティ subcells があります。ただし、ルートセル以外のセルに自分のサブセルを追加する方法がわかりません。

私はこれを2日間理解しようとしてきましたが、見つけたものは何も役に立ちませんでした.

だから、私が達成しようとしていることを見ることができます: http://jsfiddle.net/snymax/fu5hum81/22/

フィドルで少し簡単にするために、さまざまなオブジェクトを関数に分割しました

これは私が作っているよりもはるかに簡単だと確信しています。そうでない場合は、dymo labelwriter 450にカスタムレシートを印刷できる別の方法を誰も知りません

4

1 に答える 1

0

dymo の xml スキーマを見つけて、それを理解しました

RootCell は、特別な名前を持つ Cell タグであり、通常のセルでできることは何でも実行でき、その逆も可能です。 ただし、RootCell は、continuouslabel タグ内の必須タグです。

また、セルにさらにセルを含める場合は、オブジェクトを含めることはできません。また、そのプロパティは Subcells タグの前に配置する必要があります

セルにオブジェクトが含まれる場合、サブセル プロパティを含めることはできず、オブジェクトの後にセル プロパティをリストする必要があります。

簡単な例を示します

var xml = '<ContinuousLabel Version="8.0" Units="twips">\
<PaperOrientation>Portrait</PaperOrientation>\
<Id>Continuous</Id>\
<PaperName>30270 Continuous</PaperName>\
<LengthMode>Auto</LengthMode>\
<LabelLength>0</LabelLength>\
<RootCell>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
<SubcellsOrientation>Vertical</SubcellsOrientation>\
<Subcells>\
'<Cell>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
<SubcellsOrientation>Horizontal</SubcellsOrientation>\
<Subcells>\
<Cell>\
<TextObject>\
<Name>QTY</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>Center</HorizontalAlignment>\
<VerticalAlignment>Middle</VerticalAlignment>\
<TextFitMode>ShrinkToFit</TextFitMode>\
<UseFullFontHeight>True</UseFullFontHeight>\
<Verticalized>False</Verticalized>\
<StyledText>\
<Element>\
<String>' + obj.qty + '</String>\
<Attributes>\
<Font Family="Lucida Grande" Size="13" Bold="False" Italic="False" Underline="False" Strikeout="False"/>\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Attributes>\
</Element>\
</StyledText>\
</TextObject>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Cell>\
<Cell>\
<TextObject>\
<Name>NAME</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>Center</HorizontalAlignment>\
<VerticalAlignment>Middle</VerticalAlignment>\
<TextFitMode>ShrinkToFit</TextFitMode>\
<UseFullFontHeight>True</UseFullFontHeight>\
<Verticalized>False</Verticalized>\
<StyledText>\
<Element>\
<String>' + obj.name +'</String>\
<Attributes>\
<Font Family="Lucida Grande" Size="13" Bold="False" Italic="False" Underline="False" Strikeout="False"/>\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Attributes>\
</Element>\
</StyledText>\
</TextObject>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Cell>\
<Cell>\
<TextObject>\
<Name>PRICE</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>Center</HorizontalAlignment>\
<VerticalAlignment>Middle</VerticalAlignment>\
<TextFitMode>ShrinkToFit</TextFitMode>\
<UseFullFontHeight>True</UseFullFontHeight>\
<Verticalized>False</Verticalized>\
<StyledText>\
<Element>\
<String>' + obj.price + '</String>\
<Attributes>\
<Font Family="Lucida Grande" Size="13" Bold="False" Italic="False" Underline="False" Strikeout="False"/>\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Attributes>\
</Element>\
</StyledText>\
</TextObject>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Cell>\
</Subcells>\
</Cell>';
'<Cell>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
<SubcellsOrientation>Horizontal</SubcellsOrientation>\
<Subcells>\
<Cell>\
<TextObject>\
<Name>QTY</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>Center</HorizontalAlignment>\
<VerticalAlignment>Middle</VerticalAlignment>\
<TextFitMode>ShrinkToFit</TextFitMode>\
<UseFullFontHeight>True</UseFullFontHeight>\
<Verticalized>False</Verticalized>\
<StyledText>\
<Element>\
<String>' + obj.qty + '</String>\
<Attributes>\
<Font Family="Lucida Grande" Size="13" Bold="False" Italic="False" Underline="False" Strikeout="False"/>\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Attributes>\
</Element>\
</StyledText>\
</TextObject>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Cell>\
<Cell>\
<TextObject>\
<Name>NAME</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>Center</HorizontalAlignment>\
<VerticalAlignment>Middle</VerticalAlignment>\
<TextFitMode>ShrinkToFit</TextFitMode>\
<UseFullFontHeight>True</UseFullFontHeight>\
<Verticalized>False</Verticalized>\
<StyledText>\
<Element>\
<String>' + obj.name +'</String>\
<Attributes>\
<Font Family="Lucida Grande" Size="13" Bold="False" Italic="False" Underline="False" Strikeout="False"/>\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Attributes>\
</Element>\
</StyledText>\
</TextObject>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Cell>\
<Cell>\
<TextObject>\
<Name>PRICE</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>Center</HorizontalAlignment>\
<VerticalAlignment>Middle</VerticalAlignment>\
<TextFitMode>ShrinkToFit</TextFitMode>\
<UseFullFontHeight>True</UseFullFontHeight>\
<Verticalized>False</Verticalized>\
<StyledText>\
<Element>\
<String>' + obj.price + '</String>\
<Attributes>\
<Font Family="Lucida Grande" Size="13" Bold="False" Italic="False" Underline="False" Strikeout="False"/>\
<ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Attributes>\
</Element>\
</StyledText>\
</TextObject>\
<Length>0</Length>\
<LengthMode>Auto</LengthMode>\
<BorderWidth>0</BorderWidth>\
<BorderStyle>Solid</BorderStyle>\
<BorderColor Alpha="255" Red="0" Green="0" Blue="0"/>\
</Cell>\
</Subcells>\
</Cell>';
</Subcells>\
</Cell>\
</Subcells>\
</RootCell>\
</ContinuousLabel>'

これは 2 行 3 列を示しています。このソリューションに興味を持っているのは私だけかもしれませんが、dymo プリンターは市場に出回っている他のほとんどのプリンターよりも安価で使いやすいことがわかりました。

ラベルと連続ラベルの xml スキーマをここに示します: http://www.labelwriter.com/software/dls/sdk/LabelFile.xsd

于 2014-08-23T18:04:46.927 に答える