当前位置:网站首页>JS教程之使用 ElectronJS 桌面应用程序打印贴纸/标签
JS教程之使用 ElectronJS 桌面应用程序打印贴纸/标签
2022-06-26 15:54:00 【知识大胖】
在本文中,我们将讨论如何使用 Vue-ElectronJS 桌面应用程序打印特定尺寸(比如 10" X 10")的贴纸
我们看到产品信息标签贴在产品上,并附有产品和价格信息。或者有许多行业正在对产品进行测试,测试应用程序会根据其结果创建一个贴纸,并将该贴纸贴在被测产品上。
这些印刷品是如何生成并打印在贴纸上的?
我们将在本文中看到这一点。
我们正在使用带有 ElectronJS 的 VueJS 来构建我们的应用程序。由于 ElectronJS 使我们能够创建桌面应用程序,它还具有用于创建打印语句并返回其结果的内置 API。
打印普通文本 VS 打印 HTML 内容
当你想打印普通文本时,你可以直接从主窗口给出命令。但是,当您想要打印自定义 HTML 设计的内容时,您必须创建一个新窗口,您将在其中呈现 HTML 内容,然后发出命令以在此页面上打印内容。
在本文中,我们将探讨打印 HTML 内容的第二种选择。
默认情况下,ElectronJS 创建一个单独的窗口,当您想要呈现应用程序内容时它就足够了,但是当我们想要打印自定义/动态数据时,我们必须有另一个窗口来呈现这些数据。
让我们配置另一个窗口:
在你的主渲染器文件中,通常位于–src/main/index.js,你会注意到这里定义了主窗口,让我们定义另一个窗口来渲染打印内容
const printerWindow = new BrowserWindow({
show: false,
webPreferences: {
webSecurity: false,
nodeIntegratio边栏推荐
- Simple use of tensor
- 7 user defined loss function
- NFT contract basic knowledge explanation
- Audio and video learning (II) -- frame rate, code stream and resolution
- Solidus labs welcomes zhaojiali, former head of financial innovation in Hong Kong, as a strategic adviser
- 1 张量的简单使用
- Tencent Peking University's sparse large model training acceleration program het was selected into the VLDB of the international summit
- H5 close the current page, including wechat browser (with source code)
- Lifeifei's team applied vit to the robot, increased the maximum speed of planning reasoning by 512 times, and also cued hekaiming's Mae
- svg canvas画布拖拽
猜你喜欢

油田勘探问题

Tweenmax+svg switch color animation scene

Svg capital letter a animation JS effect

NFT contract basic knowledge explanation

(1) Keras handwritten numeral recognition and recognition of self written numbers

canvas三个圆点闪烁动画

李飞飞团队将ViT用在机器人身上,规划推理最高提速512倍,还cue了何恺明的MAE...

Application of ansible automation

Stepn débutant et avancé

Ten thousand words! In depth analysis of the development trend of multi-party data collaborative application and privacy computing under the data security law
随机推荐
Comprehensive analysis of discord security issues
Tencent Peking University's sparse large model training acceleration program het was selected into the VLDB of the international summit
10 tf. data
The details of the first pig heart transplantation were fully disclosed: human herpes virus was found in the patient, the weight of the heart doubled after death, and myocardial cell fibrosis
NFT transaction principle analysis (1)
Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
Analyse panoramique de la chaîne industrielle en amont, en aval et en aval de la NFT « Dry goods»
8 user defined evaluation function
NFT Platform Security Guide (1)
人人都当科学家之免Gas体验mint爱死机
R语言plotly可视化:小提琴图、多分类变量小提琴图、分组(grouped)小提琴图、分裂的分组小提琴图、每个小提琴图内部分为两组数据、每个分组占小提琴图的一半、自定义小提琴图的调色板、抖动数据点
Simple use of tensor
SAP OData development tutorial - from getting started to improving (including segw, rap and CDP)
Ideal path problem
Panoramic analysis of upstream, middle and downstream industrial chain of "dry goods" NFT
How to create your own NFT (polygon) on opensea
Anaconda3安装tensorflow 2.0版本cpu和gpu安装,Win10系统
(一)keras手写数字体识别并识别自己写的数字
The first batch in the industry! Tencent cloud security and privacy computing products based on angel powerfl passed CFCA evaluation
svg上升的彩色气泡动画