+
Custom Print
- + Select device:
diff --git a/www/custom-print.js b/www/custom-print.js index 9c6a938..22386ad 100644 --- a/www/custom-print.js +++ b/www/custom-print.js @@ -4,7 +4,7 @@ class CustomPrinter { WIDTH = 384; threshold = 0.6; - bluetoothMACInput = document.getElementById('bt_mac'); + bluetoothMACInput = document.getElementById('bluetooth_address_input'); thresholdInput = document.getElementById('filter_threshold'); fileSelection = document.createElement('input'); dummyImage = new Image(); @@ -60,10 +60,13 @@ class CustomPrinter { this.actionInsertQR.addEventListener('click', event => { let div = document.createElement('div'); new QRCode(div, prompt(i18N.get('Content of QRCode:'))); - // QRCode generation is async, currently no better way than wait for a while + // QRCode generation is async, currently have no better way than waiting for a while setTimeout(() => { - let fimage = new fabric.Image(div.lastChild, {}); - fimage.scale(this.WIDTH / div.lastChild.width); + let fimage = new fabric.Image(div.lastChild, { + left: this.WIDTH / 4, + top: this.WIDTH / 4 + }); + fimage.scale((this.WIDTH / 2) / div.lastChild.width); this.fabricCanvas.add(fimage); }, 1000); }); diff --git a/www/help/help.en-US.html b/www/help/help.en-US.html new file mode 100644 index 0000000..5ab909d --- /dev/null +++ b/www/help/help.en-US.html @@ -0,0 +1,33 @@ + + +
+ + + +Help
+Here is some useful information.
+Note
+-
+
- Preview (and printed) image is mono-colored. Only black and white. +
- Threshold is the "darkness" required for image pixels to turning black. The higher it is, the image is brighter. +
+
Function
+Print Image
+You can print an image to cat printer in that page.
+Select a photo, click preview, check the preview and adjust threshold.
+When satisfied, select printer device and print!
+Print Document
+Simply copy-paste your document content from office software to that page, the format is preserved and the result can be previewed.
+Image can't be there because of security policy. Please use "Custom Print" if necessory.
+Custom Print
+You can freely arrange the content of a canvas then print it. Insert/edit text, image, or QRCode.
++
帮助
+这里有一些有用的信息。
+注记
+-
+
- 预览与打印出的图像是单色的。只有黑色和白色。 +
- 阈值是像素变为黑色所需的“黑度”。它的值越高,图像越亮。 +
+
功能
+打印图片
+您可以在此页将图像打印至猫咪打印机。
+选择图片,点击预览,检查预览并调整阈值。
+感觉满意后,选择打印机设备并打印!
+打印文档
+只需把文档从办公软件复制粘贴到此页,文档格式被保留且可以预览。
+由于安全策略,无法粘贴图像。如果需要请使用“自定义打印”。
+自定义打印
+您可以自由排布画布上的内容并打印。插入/编辑文字、图像或二维码。
++
Help Documents
+ + + + \ No newline at end of file diff --git a/www/index.html b/www/index.html index 1b0eca8..28d2abb 100644 --- a/www/index.html +++ b/www/index.html @@ -11,11 +11,12 @@Printer Center
-- Print Image - Print Document - Custom Print -
++
Print Document
- + Select device:
@@ -28,7 +28,7 @@
-From Webpage/MS Office/WPS/LibreOffice to here, pasted data shall be formatted
+From Webpage/MS Office/WPS/LibreOffice to here, pasted data shall be formatted
Preview
+
Print Image
- + Select device:
diff --git a/www/print-image.js b/www/print-image.js index 890871d..4788e7c 100644 --- a/www/print-image.js +++ b/www/print-image.js @@ -4,7 +4,7 @@ class ImagePrinter { WIDTH = 384; threshold = 0.6; - bluetoothMACInput = document.getElementById('bt_mac'); + bluetoothMACInput = document.getElementById('bluetooth_address_input'); thresholdInput = document.getElementById('filter_threshold'); fileSelection = document.getElementById('file_selection'); dummyImage = new Image();