提交 0413777e 编写于 作者: Q qnxf-congshuo

打印机

上级 a4cfad7f
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="0f054e50-c022-4836-8ffc-3714eca25e89" name="Default Changelist" comment="" />
<list default="true" id="0f054e50-c022-4836-8ffc-3714eca25e89" name="Default Changelist" comment="s">
<change afterPath="$PROJECT_DIR$/.vscode/settings.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/打印机/try.html" beforeDir="false" afterPath="$PROJECT_DIR$/打印机/try.html" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -11,15 +15,90 @@
<component name="CodeStyleSettingsInfer">
<option name="done" value="true" />
</component>
<component name="DefaultGradleProjectSettings">
<option name="testRunner" value="GRADLE" />
<option name="delegatedBuild" value="true" />
</component>
<component name="FileEditorManager">
<leaf>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/1.hello word.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="247">
<caret line="13" column="5" selection-start-line="13" selection-start-column="5" selection-end-line="13" selection-end-column="5" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/打印机/try.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="606">
<caret line="76" column="40" lean-forward="true" selection-start-line="76" selection-start-column="40" selection-end-line="76" selection-end-column="40" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/BrowserPrint-3.0.216.min.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="304">
<caret line="16" lean-forward="true" selection-start-line="16" selection-end-line="16" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
<option name="SET_USER_NAME_GLOBALLY" value="false" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/打印机/try.html" />
</list>
</option>
</component>
<component name="ProjectCodeStyleSettingsMigration">
<option name="version" value="1" />
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="263" />
<option name="y" value="20" />
<option name="width" value="1397" />
<option name="height" value="1000" />
</component>
<component name="ProjectId" id="1s7H6OH9ujUixOuLbD3szuCjoq6" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="vue" type="b2602c69:ProjectViewProjectNode" />
<item name="vue" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="vue" type="b2602c69:ProjectViewProjectNode" />
<item name="vue" type="462c0819:PsiDirectoryNode" />
<item name="打印机" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
......@@ -61,6 +140,43 @@
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="6638000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Image Layers" />
<window_info id="Designer" />
<window_info id="UI Designer" />
<window_info id="Capture Tool" />
<window_info id="Favorites" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.058102347" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Docker" show_stripe_button="false" />
<window_info anchor="bottom" id="Database Changes" />
<window_info anchor="bottom" id="Version Control" />
<window_info anchor="bottom" id="Terminal" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="right" id="Palette" />
<window_info anchor="right" id="Theme Preview" />
<window_info anchor="right" id="Maven" />
<window_info anchor="right" id="Capture Analysis" />
<window_info anchor="right" id="Palette&#9;" />
<window_info anchor="right" id="Database" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
......@@ -70,12 +186,59 @@
<entry key="MAIN">
<value>
<State>
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
<option name="COLUMN_ORDER" />
</State>
</value>
</entry>
</map>
</option>
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list />
</value>
</entry>
<entry key="User">
<value>
<list />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="s" />
<option name="LAST_COMMIT_MESSAGE" value="s" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/1.hello word.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="247">
<caret line="13" column="5" selection-start-line="13" selection-start-column="5" selection-end-line="13" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/BrowserPrint-3.0.216.min.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="304">
<caret line="16" lean-forward="true" selection-start-line="16" selection-end-line="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/打印机/try.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="606">
<caret line="76" column="40" lean-forward="true" selection-start-line="76" selection-start-column="40" selection-end-line="76" selection-end-column="40" />
</state>
</provider>
</entry>
</component>
<component name="ideajad">
<property name="annotate" value="false" />
......
{
}
\ No newline at end of file
......@@ -21,8 +21,8 @@
$("#dayin").click(function() {
//斑马打印机用
var selected_device;
console.log("=================1=============")
var errorCallback = function(errorMessage) {
console.log("=========error=====" + errorMessage)
alert("Error: " + errorMessage);
}
......@@ -30,35 +30,54 @@
function setup() {
//首先从应用程序中获取默认设备。
BrowserPrint.getDefaultDevice("printer", function(device) {
console.log("=================2=============")
//添加设备
console.log(device)
//添加设备
selected_device = device;
if (selected_device !== undefined) {
var code = "AABBCCDDFF"
send(code)
selected_device = undefined;
}
}, function(error) {
alert(error);
})
}
setup();
for (let i = 0; i < 10; i++) {
setTimeout(function(){
console.log("====================="+ (i * 4000))
setup();
}, i * 4000);
}
/**
^XA 开始 ^XZ 结束
^LH起始坐标 ^PR进纸回纸速度 ^MD 对比度
^FO标签左上角坐标 ^XG打印图片参数1图片名称后两个为坐标
^FS标签结束符 ^CI切换国际字体 ^FT坐标 ^FD定义一个字符串
^A定义字体 ^FH十六进制数 ^BY模块化label ^BC条形码128
^PQ打印设置 参数一 打印数量 参数二暂停 参数三重复数量 参数四为Y时表明无暂停
^XA 开始 ^XZ 结束
^LH起始坐标(LH 0,0)距离左侧的距离) ^PR进纸回纸速度 ^MD 对比度
^FO标签左上角坐标 ^XG打印图片参数1图片名称后两个为坐标
^FS标签结束符 ^CI切换国际字体 ^FT坐标 ^FD定义一个字符串
^A定义字体 ^FH十六进制数 ^BY模块化label ^BC条形码128
^PQ打印设置 参数一 打印数量 参数二暂停 参数三重复数量 参数四为Y时表明无暂停
^FDMM 指定二维码里的内容
^BQN 指代二维码
^AON,24,24 指代普通字符 24,24指代字体大小
**/
function send(code) {
// var printString = '^LH480,^FO80,^XG' + code + '^FS\n';
// var printString = '^XA^JMA^LL450^PW700^MD0^PR3^PON^LRN^LH0,0^CI26^FO200,30^BQN,2,5^FDHM,B0200' + code + '^FS^XZ';
var printString = '^XA^JMA^LL480^LH490,0^CI26^FO80,40^BQN' + code + '^FS^XZ';
selected_device.send(printString, undefined, errorCallback);
var printString = '^XA' +
'^FO100,100^JMA^LL480^LH534,0^CI26' +
'^FO80,40^BQN^FDMM,' + code + '^FS' +
'^FO60,120^A0N,24,24^FD'+ code + '^FS' +
'^XZ\n';
console.log(selected_device)
var oo = selected_device.send(printString, undefined, errorCallback);
console.log(oo)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册