vg-print 1.0.304 → 1.0.305
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/vg-print.es.js +3555 -3561
- package/dist/vg-print.umd.js +95 -95
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -182,13 +182,13 @@ tpl.toPdf({ name: '示例' }, '打印预览pdf', { paperWidth: 210, paperHeight:
|
|
|
182
182
|
tpl.toImage({ name: '示例' }, { isDownload: true, name: '图片', limit: 1, type: 'image/jpeg', pixelRatio: 2 })
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
水印与授权行为说明:设计态与运行态分离。设计态不自动显示默认水印(由面板设置项决定);运行态由授权控制。
|
|
186
186
|
|
|
187
187
|
### 授权密钥(authKey)与默认水印
|
|
188
188
|
|
|
189
189
|
- 行为说明:
|
|
190
|
-
- 设计态(FullDesigner
|
|
191
|
-
- 运行态(预览、浏览器打印、导出 PDF/图片、直连打印):未注册 `authKey`
|
|
190
|
+
- 设计态(FullDesigner 设计界面):不自动注入默认水印;是否显示水印由面板中的“水印功能”设置项决定,与 `authKey` 无关。
|
|
191
|
+
- 运行态(预览、浏览器打印、导出 PDF/图片、直连打印):未注册 `authKey` 时显示默认水印 `{ content: 'vg-print', timestamp: true }`;注册有效 `authKey` 后默认水印移除。
|
|
192
192
|
- 适用于所有入口:完整设计器组件、直接 `new hiprint.PrintTemplate(...)`、以及轻量运行时 API(`createTemplate`)。
|
|
193
193
|
|
|
194
194
|
- 全局注册授权密钥:
|
|
@@ -199,7 +199,7 @@ import { hiprint } from 'vg-print'
|
|
|
199
199
|
// 注册授权 key(建议在应用启动时调用)
|
|
200
200
|
hiprint.register({ authKey: '你的key' })
|
|
201
201
|
|
|
202
|
-
// 有授权 key →
|
|
202
|
+
// 有授权 key → 运行态默认水印移除(设计态由面板设置项决定)
|
|
203
203
|
const tpl = new hiprint.PrintTemplate({ template: {} })
|
|
204
204
|
```
|
|
205
205
|
|
|
@@ -227,7 +227,7 @@ const tpl2 = createTemplate(tmplJson, {
|
|
|
227
227
|
watermarkOptions: { content: 'your-brand', timestamp: true }
|
|
228
228
|
})
|
|
229
229
|
|
|
230
|
-
//
|
|
230
|
+
// 设计态由面板设置项决定水印,不受 authKey 控制。
|
|
231
231
|
// 运行态的默认水印由授权控制,不建议通过传入空对象取消;如需取消,请注册有效 authKey。
|
|
232
232
|
const tpl3 = new hiprint.PrintTemplate({ template: {}, watermarkOptions: { content: 'your-brand', timestamp: true } })
|
|
233
233
|
```
|