Forráskód Böngészése

添加了打印图片的功能

Kevin 5 éve
szülő
commit
aa27534a7c

BIN
dll/GetEasy.Node.Printer.64.dll


BIN
dll/GetEasy.Node.Printer.86.dll


BIN
dll/GetEasy.Node.Printer.dll


+ 8 - 0
index.d.ts

@@ -24,5 +24,13 @@ export default class ReportApi {
      * @memberof ReportApi
      */
     static reportPrinter(fileName: string, jsonData: string, isSelectPrinter: boolean): void;
+    /**
+     * 打印到图片(返回base64图片)
+     *
+     * @param {string} fileName 模板路径
+     * @param {string} jsonData 数据
+     * @memberof ReportApi
+     */
+    static reportToImage(fileName: string, jsonData: string): string;
 }
 export {};

+ 11 - 0
index.js

@@ -23,6 +23,7 @@ var dll = ffi.Library(dllPath, {
     designerReport: ['void', ['string', 'string']],
     reportShowPreview: ['void', ['string', 'string']],
     reportPrinter: ['void', ['string', 'string', 'bool']],
+    ReportToImage: ['string', ['string', 'string']],
     waitSaveOrClose: ['void', ['pointer']]
 });
 var ReportApi = /** @class */ (function () {
@@ -80,6 +81,16 @@ var ReportApi = /** @class */ (function () {
     ReportApi.reportPrinter = function (fileName, jsonData, isSelectPrinter) {
         dll.reportPrinter(fileName, jsonData, isSelectPrinter);
     };
+    /**
+     * 打印到图片(返回base64图片)
+     *
+     * @param {string} fileName 模板路径
+     * @param {string} jsonData 数据
+     * @memberof ReportApi
+     */
+    ReportApi.reportToImage = function (fileName, jsonData) {
+        return dll.reportToImage(fileName, jsonData);
+    };
     return ReportApi;
 }());
 exports["default"] = ReportApi;

+ 2 - 4
package.json

@@ -1,6 +1,6 @@
 {
   "name": "geteasy.node.printer",
-  "version": "1.1.1",
+  "version": "1.1.2",
   "description": "",
   "main": "index.js",
   "scripts": {
@@ -10,9 +10,7 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
-    "ffi": "github:Im-Kevin/node-ffi#node-12",    
-    "ref": "github:Im-Kevin/ref#node-12",
-    "ref-struct": "github:Im-Kevin/ref-struct#node-12",
+    "ffi": "^2.3.0",
     "os": "^0.1.1"
   },
   "devDependencies": {