@pdftron/cad 10.10.0-1-beta

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.
Files changed (3) hide show
  1. package/license.pdf +0 -0
  2. package/package.json +30 -0
  3. package/readme.md +57 -0
package/license.pdf ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@pdftron/cad",
3
+ "version": "10.10.0-1-beta",
4
+ "main": "./lib/main.js",
5
+ "binary": {
6
+ "module_name": "ApryseIDP",
7
+ "module_path": "./lib",
8
+ "remote_path": "./downloads/PDFNetNode/CAD",
9
+ "package_name": "cad-{version}-{platform}-{arch}.tar.gz",
10
+ "host": "https://www.pdftron.com"
11
+ },
12
+ "scripts": {
13
+ "install": "node-pre-gyp install --fallback-to-build"
14
+ },
15
+ "engines" : { "node" : ">=8 <=22" },
16
+ "description": "The Apryse SDK CAD Module.",
17
+ "author": "Apryse Software Inc.",
18
+ "license": "Commercial",
19
+ "homepage": "https://www.apryse.com",
20
+ "dependencies": {
21
+ "@pdftron/pdfnet-node": "10.10.0-1-beta",
22
+ "@mapbox/node-pre-gyp": "^1.0.3"
23
+ },
24
+ "keywords": [
25
+ "PDF",
26
+ "Office",
27
+ "SDK",
28
+ "CAD"
29
+ ]
30
+ }
package/readme.md ADDED
@@ -0,0 +1,57 @@
1
+ ## @pdftron/cad
2
+
3
+ This package is meant to be used in conjunction with @pdftron/pdfnet-node to support CAD conversion from Apryse. Follow this guide for more info on usage.
4
+ https://docs.apryse.com/documentation/core/guides/features/conversion/convert-cad-to-pdf/
5
+
6
+ For further reading checkout our blog post on the project.
7
+ https://apryse.com/blog/conversion/converting-cad-to-pdf
8
+
9
+ #### Supported platform, Node.js, and Electron versions
10
+ This package depends on unmanaged add-on binaries, and the add-on binaries are not cross-platform. At the moment we have support for
11
+ * **OS**: Linux (excluding Alpine), Windows(x64)
12
+ * **Node.js version**: 8 - 22
13
+ * **Electron version**: 6 - 30
14
+
15
+ Installation will fail if your OS, Node.js or Electron version is not supported.
16
+
17
+ #### Usage
18
+
19
+ Add the `@pdftron/cad` package as a dependency in your `package.json`
20
+
21
+ Inside of your @pdftron/pdfnet-node code after initialization you should include the following line:
22
+
23
+ ```javascript
24
+ await PDFNet.addResourceSearchPath("./node_modules/@pdftron/cad/lib")
25
+ ```
26
+
27
+ Here is an example of data extraction being used with this line.
28
+
29
+ ```javascript
30
+ const { PDFNet } = require('@pdftron/pdfnet-node');
31
+ const licenseKey = "Insert license key here"
32
+ const inputFile = "Insert input file location here"
33
+
34
+ async function main() {
35
+ // This is where we import data-extraction
36
+ await PDFNet.addResourceSearchPath("./node_modules/@pdftron/cad/lib")
37
+
38
+ const doc = await PDFNet.PDFDoc.create();
39
+
40
+ await PDFNet.Convert.fromCAD(doc, inputFile);
41
+
42
+ const outputFile = 'out/converted_cad.pdf';
43
+ await doc.save(outputFile, PDFNet.SDFDoc.SaveOptions.e_linearized);
44
+ }
45
+
46
+ PDFNet.runWithCleanup(main, licenseKey).catch(function (error) {
47
+ console.log('Error: ' + JSON.stringify(error));
48
+ }).then(function () { return PDFNet.shutdown(); });;
49
+
50
+ ```
51
+
52
+ A larger code sample can be found [here](https://docs.apryse.com/documentation/samples/node/js/CAD2PDFTest/)
53
+
54
+ To get started please see the documentation at https://www.pdftron.com/documentation/nodejs/get-started/integration.
55
+
56
+ #### Licensing
57
+ Please go to https://docs.apryse.com/documentation/core/info/license/ to obtain a demo or production license.