diff --git a/README.md b/README.md index 588a920..3f13c1d 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ English | [简体中文](README.zh-CN.md) ## Features - Print jpg/png images directly to cat printer from a web interface +- Print a document (.doc, .docx, .odt etc) by copy-paste - (more will be here...) ## How to use @@ -50,21 +51,6 @@ Possible features: - Remote print with printer protocols -### Other - -Routine of image data when printing: - -`Image.png -> paint to canvas rawdata -> monochrome filter -> collect canvas rawdata to pbm format -> send to server -> extract information -> compile to raw data for printer -> bluetooth communication to printer` - -Note: PBM is a easy monochrome image format: - -``` -P4 -# {comment} -{width} {height} -{raw bytes, one byte for 8 bits of 0 or 1, these consists the image visually} -``` - ### Files - `server.py`: Contains a BaseHTTP server that hooks user actions and printer driver diff --git a/README.zh-CN.md b/README.zh-CN.md index fd98ae6..4435dd4 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -9,6 +9,7 @@ ## 功能 - 直接从网页界面打印 jpg/png 图像到猫咪打印机 +- 复制粘贴文档内容(.doc, .docx, .odt 等)以打印 - (会有更多……) ## 如何使用 @@ -29,37 +30,28 @@ TODO ## 开发者注记 -此 App 使用服务器/客户端模型,且拥有尽可能少的依赖。 +此 App 使用服务器/客户端模型,且拥有尽可能少的服务端依赖。 -您所需要的只有 Python3 (pip 可有可无) 以及一个浏览器。 +### 准备 + +- Python3 与浏览器 +- [fabric.min.js](https://github.com/fabricjs/fabric.js/tree/master/dist) +- [html2canvas.min.js](https://html2canvas.hertzen.com/) + +### 支持的平台 它同时包含对 Windows 和 GNU/Linux 的支持。Windows 发行包将包含一个**普通**用户所需要的所有。 -计划: +### 计划 -- 支持(富)文本的直接打印,使用 HTML canvas +- 支持高级编辑,如同官方应用 (iPrint & 精准学习) - 使 web 界面的远程打印标准化/兼容/安全 可能的功能: -- 支持高级编辑,如同官方应用 (iPrint & 精准学习) - 使用打印协议的远程打印 -打印时的图像数据路线: - -`图像.png -> 绘制到 canvas 纯数据 -> 双色化滤镜 -> 将 canvas 数据转为 pbm 格式 -> 发送至服务器 -> 分析出数据 -> 编译至打印机纯数据 -> 与打印机蓝牙通讯` - -注:PBM 是一种简单的双色图像格式: - -``` -P4 -# {注释} -{宽} {高} -{纯数据,一字节代表 8 比特的 0 或 1,它们从视觉上构成图像} -``` - ## 文件 -- `index.html`: 打印机的前端接口入口 - `server.py`: 包含一个 BaseHTTP 服务器,关联用户操作与打印机驱动 - `printer.py`: 包含蓝牙猫咪打印机的驱动,依赖 bleak。您也可以在命令行中运行此文件。 diff --git a/www/custom-print.html b/www/custom-print.html index cd0d7c1..5a28449 100644 --- a/www/custom-print.html +++ b/www/custom-print.html @@ -5,6 +5,7 @@