n8n-nodes-morphopdf 1.1.0
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/LICENSE.md +21 -0
- package/README.md +103 -0
- package/dist/credentials/MorphoPdfApi.credentials.d.ts +11 -0
- package/dist/credentials/MorphoPdfApi.credentials.d.ts.map +1 -0
- package/dist/credentials/MorphoPdfApi.credentials.js +38 -0
- package/dist/credentials/MorphoPdfApi.credentials.js.map +1 -0
- package/dist/nodes/MorphoPdf/MorphoPdf.node.d.ts +6 -0
- package/dist/nodes/MorphoPdf/MorphoPdf.node.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/MorphoPdf.node.js +242 -0
- package/dist/nodes/MorphoPdf/MorphoPdf.node.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/compress.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/compress.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/compress.operation.js +30 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/compress.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/crop.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/crop.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/crop.operation.js +42 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/crop.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/merge.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/merge.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/merge.operation.js +38 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/merge.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/organize.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/organize.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/organize.operation.js +41 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/organize.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/rotate.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/rotate.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/rotate.operation.js +32 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/rotate.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/split.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/split.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/split.operation.js +43 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/split.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/watermark.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/watermark.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/watermark.operation.js +50 -0
- package/dist/nodes/MorphoPdf/actions/documentManagement/watermark.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/excelToPdf.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/excelToPdf.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/excelToPdf.operation.js +28 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/excelToPdf.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/htmlToPdf.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/htmlToPdf.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/htmlToPdf.operation.js +40 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/htmlToPdf.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/imageToPdf.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/imageToPdf.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/imageToPdf.operation.js +34 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/imageToPdf.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/markdownToPdf.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/markdownToPdf.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/markdownToPdf.operation.js +37 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/markdownToPdf.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/powerpointToPdf.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/powerpointToPdf.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/powerpointToPdf.operation.js +28 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/powerpointToPdf.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/wordToPdf.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/wordToPdf.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/wordToPdf.operation.js +28 -0
- package/dist/nodes/MorphoPdf/actions/formatToPdf/wordToPdf.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToExcel.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToExcel.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToExcel.operation.js +28 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToExcel.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToImage.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToImage.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToImage.operation.js +40 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToImage.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToPowerpoint.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToPowerpoint.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToPowerpoint.operation.js +28 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToPowerpoint.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToWord.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToWord.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToWord.operation.js +30 -0
- package/dist/nodes/MorphoPdf/actions/pdfToFormat/pdfToWord.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/protect.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/protect.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/protect.operation.js +43 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/protect.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/sign.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/sign.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/sign.operation.js +45 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/sign.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/unlock.operation.d.ts +3 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/unlock.operation.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/unlock.operation.js +36 -0
- package/dist/nodes/MorphoPdf/actions/securitySigning/unlock.operation.js.map +1 -0
- package/dist/nodes/MorphoPdf/morphopdf.svg +9 -0
- package/dist/nodes/MorphoPdf/shared/descriptions.d.ts +182 -0
- package/dist/nodes/MorphoPdf/shared/descriptions.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/shared/descriptions.js +859 -0
- package/dist/nodes/MorphoPdf/shared/descriptions.js.map +1 -0
- package/dist/nodes/MorphoPdf/shared/errors.d.ts +11 -0
- package/dist/nodes/MorphoPdf/shared/errors.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/shared/errors.js +44 -0
- package/dist/nodes/MorphoPdf/shared/errors.js.map +1 -0
- package/dist/nodes/MorphoPdf/shared/helpers.d.ts +31 -0
- package/dist/nodes/MorphoPdf/shared/helpers.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/shared/helpers.js +183 -0
- package/dist/nodes/MorphoPdf/shared/helpers.js.map +1 -0
- package/dist/nodes/MorphoPdf/shared/types.d.ts +66 -0
- package/dist/nodes/MorphoPdf/shared/types.d.ts.map +1 -0
- package/dist/nodes/MorphoPdf/shared/types.js +3 -0
- package/dist/nodes/MorphoPdf/shared/types.js.map +1 -0
- package/package.json +61 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MorphoPDF
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# n8n-nodes-morphopdf
|
|
2
|
+
|
|
3
|
+
> n8n community node for [MorphoPDF](https://morphopdf.com) - Professional PDF processing and conversion
|
|
4
|
+
|
|
5
|
+
This node allows you to use the MorphoPDF API in your n8n workflows to merge, split, compress, convert, and manipulate PDF files.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
### PDF Operations
|
|
10
|
+
- **Merge** - Combine multiple PDFs into one
|
|
11
|
+
- **Split** - Split PDF by page ranges or extract individual pages
|
|
12
|
+
- **Compress** - Reduce PDF file size
|
|
13
|
+
- **Rotate** - Rotate pages by 90°, 180°, or 270°
|
|
14
|
+
- **Watermark** - Add text or image watermarks
|
|
15
|
+
- **Protect** - Add password protection
|
|
16
|
+
- **Unlock** - Remove password protection
|
|
17
|
+
|
|
18
|
+
### Conversions
|
|
19
|
+
- **PDF to Word** - Convert PDF to DOCX
|
|
20
|
+
- **PDF to Excel** - Extract tables to XLSX
|
|
21
|
+
- **PDF to PowerPoint** - Convert PDF to PPTX
|
|
22
|
+
- **PDF to Image** - Convert pages to PNG/JPG
|
|
23
|
+
- **Word to PDF** - Convert DOCX to PDF
|
|
24
|
+
- **Excel to PDF** - Convert XLSX to PDF
|
|
25
|
+
- **PowerPoint to PDF** - Convert PPTX to PDF
|
|
26
|
+
- **Image to PDF** - Combine images into PDF
|
|
27
|
+
- **HTML to PDF** - Render webpage or HTML to PDF
|
|
28
|
+
- **Markdown to PDF** - Convert Markdown to PDF
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
### Community Nodes (Recommended)
|
|
33
|
+
|
|
34
|
+
1. Go to **Settings > Community Nodes**
|
|
35
|
+
2. Select **Install**
|
|
36
|
+
3. Enter `n8n-nodes-morphopdf`
|
|
37
|
+
4. Agree to the risks and click **Install**
|
|
38
|
+
|
|
39
|
+
### Manual Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install n8n-nodes-morphopdf
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Credentials
|
|
46
|
+
|
|
47
|
+
1. Sign up at [MorphoPDF](https://morphopdf.com)
|
|
48
|
+
2. Go to your Dashboard and copy your API key
|
|
49
|
+
3. In n8n, create new credentials for "MorphoPDF API"
|
|
50
|
+
4. Paste your API key (starts with `pk_`)
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
### Input Methods
|
|
55
|
+
|
|
56
|
+
Each operation supports two input methods:
|
|
57
|
+
|
|
58
|
+
1. **Binary Data** - Use file data from a previous node (HTTP Request, Read Binary File, etc.)
|
|
59
|
+
2. **URL** - Provide a public URL to the file
|
|
60
|
+
|
|
61
|
+
### Example: Merge PDFs
|
|
62
|
+
|
|
63
|
+
1. Add multiple PDF files using HTTP Request nodes or file inputs
|
|
64
|
+
2. Add the MorphoPDF node
|
|
65
|
+
3. Select **PDF > Merge**
|
|
66
|
+
4. Choose **Binary Data** input method
|
|
67
|
+
5. Execute the workflow
|
|
68
|
+
|
|
69
|
+
### Example: Compress PDF
|
|
70
|
+
|
|
71
|
+
1. Add a PDF file to your workflow
|
|
72
|
+
2. Add the MorphoPDF node
|
|
73
|
+
3. Select **PDF > Compress**
|
|
74
|
+
4. Choose quality level (Low = smallest file, High = best quality)
|
|
75
|
+
5. Execute the workflow
|
|
76
|
+
|
|
77
|
+
### Example: Convert PDF to Word
|
|
78
|
+
|
|
79
|
+
1. Add a PDF file to your workflow
|
|
80
|
+
2. Add the MorphoPDF node
|
|
81
|
+
3. Select **Convert > PDF to Word**
|
|
82
|
+
4. Enable OCR if the PDF contains scanned images
|
|
83
|
+
5. Execute the workflow
|
|
84
|
+
|
|
85
|
+
## Error Handling
|
|
86
|
+
|
|
87
|
+
The node provides clear error messages for common issues:
|
|
88
|
+
|
|
89
|
+
- **Invalid API key** - Check your credentials
|
|
90
|
+
- **Rate limit exceeded** - Upgrade your plan or wait
|
|
91
|
+
- **File too large** - Maximum 50MB per file
|
|
92
|
+
- **Invalid file type** - Check the input file format
|
|
93
|
+
- **Password protected** - Use the Unlock operation first
|
|
94
|
+
|
|
95
|
+
## Resources
|
|
96
|
+
|
|
97
|
+
- [MorphoPDF Website](https://morphopdf.com)
|
|
98
|
+
- [API Documentation](https://docs.morphopdf.com/api)
|
|
99
|
+
- [n8n Community](https://community.n8n.io)
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
[MIT](LICENSE.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class MorphoPdfApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: "file:../nodes/MorphoPdf/morphopdf.svg";
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=MorphoPdfApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MorphoPdfApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/MorphoPdfApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,qBAAa,YAAa,YAAW,eAAe;IAClD,IAAI,SAAkB;IACtB,WAAW,SAAmB;IAC9B,gBAAgB,SAAgC;IAChD,IAAI,EAAG,uCAAuC,CAAU;IAExD,UAAU,EAAE,eAAe,EAAE,CAW3B;IAEF,YAAY,EAAE,oBAAoB,CAOhC;IAEF,IAAI,EAAE,sBAAsB,CAM1B;CACH"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MorphoPdfApi = void 0;
|
|
4
|
+
class MorphoPdfApi {
|
|
5
|
+
name = 'morphoPdfApi';
|
|
6
|
+
displayName = 'MorphoPDF API';
|
|
7
|
+
documentationUrl = 'https://docs.morphopdf.com';
|
|
8
|
+
icon = 'file:../nodes/MorphoPdf/morphopdf.svg';
|
|
9
|
+
properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API Key',
|
|
12
|
+
name: 'apiKey',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'Your MorphoPDF API key (starts with pk_)',
|
|
18
|
+
placeholder: 'pk_xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
authenticate = {
|
|
22
|
+
type: 'generic',
|
|
23
|
+
properties: {
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: '=Bearer {{$credentials?.apiKey}}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
test = {
|
|
30
|
+
request: {
|
|
31
|
+
baseURL: 'https://api.morphopdf.com/v1',
|
|
32
|
+
url: '/rate-limit-status',
|
|
33
|
+
method: 'GET',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.MorphoPdfApi = MorphoPdfApi;
|
|
38
|
+
//# sourceMappingURL=MorphoPdfApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MorphoPdfApi.credentials.js","sourceRoot":"","sources":["../../credentials/MorphoPdfApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,YAAY;IACvB,IAAI,GAAG,cAAc,CAAC;IACtB,WAAW,GAAG,eAAe,CAAC;IAC9B,gBAAgB,GAAG,4BAA4B,CAAC;IAChD,IAAI,GAAG,uCAAgD,CAAC;IAExD,UAAU,GAAsB;QAC9B;YACE,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC/B,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,0CAA0C;YACvD,WAAW,EAAE,6BAA6B;SAC3C;KACF,CAAC;IAEF,YAAY,GAAyB;QACnC,IAAI,EAAE,SAAS;QACf,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,aAAa,EAAE,kCAAkC;aAClD;SACF;KACF,CAAC;IAEF,IAAI,GAA2B;QAC7B,OAAO,EAAE;YACP,OAAO,EAAE,8BAA8B;YACvC,GAAG,EAAE,oBAAoB;YACzB,MAAM,EAAE,KAAK;SACd;KACF,CAAC;CACH;AAnCD,oCAmCC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class MorphoPdf implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=MorphoPdf.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MorphoPdf.node.d.ts","sourceRoot":"","sources":["../../../nodes/MorphoPdf/MorphoPdf.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAgFtB,qBAAa,SAAU,YAAW,SAAS;IACzC,WAAW,EAAE,oBAAoB,CA4E/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAiJxE"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MorphoPdf = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const descriptions_1 = require("./shared/descriptions");
|
|
6
|
+
// Document Management operations
|
|
7
|
+
const merge_operation_1 = require("./actions/documentManagement/merge.operation");
|
|
8
|
+
const split_operation_1 = require("./actions/documentManagement/split.operation");
|
|
9
|
+
const compress_operation_1 = require("./actions/documentManagement/compress.operation");
|
|
10
|
+
const rotate_operation_1 = require("./actions/documentManagement/rotate.operation");
|
|
11
|
+
const crop_operation_1 = require("./actions/documentManagement/crop.operation");
|
|
12
|
+
const organize_operation_1 = require("./actions/documentManagement/organize.operation");
|
|
13
|
+
const watermark_operation_1 = require("./actions/documentManagement/watermark.operation");
|
|
14
|
+
// Security & Signing operations
|
|
15
|
+
const sign_operation_1 = require("./actions/securitySigning/sign.operation");
|
|
16
|
+
const protect_operation_1 = require("./actions/securitySigning/protect.operation");
|
|
17
|
+
const unlock_operation_1 = require("./actions/securitySigning/unlock.operation");
|
|
18
|
+
// PDF to Format operations
|
|
19
|
+
const pdfToWord_operation_1 = require("./actions/pdfToFormat/pdfToWord.operation");
|
|
20
|
+
const pdfToExcel_operation_1 = require("./actions/pdfToFormat/pdfToExcel.operation");
|
|
21
|
+
const pdfToPowerpoint_operation_1 = require("./actions/pdfToFormat/pdfToPowerpoint.operation");
|
|
22
|
+
const pdfToImage_operation_1 = require("./actions/pdfToFormat/pdfToImage.operation");
|
|
23
|
+
// Format to PDF operations
|
|
24
|
+
const wordToPdf_operation_1 = require("./actions/formatToPdf/wordToPdf.operation");
|
|
25
|
+
const excelToPdf_operation_1 = require("./actions/formatToPdf/excelToPdf.operation");
|
|
26
|
+
const powerpointToPdf_operation_1 = require("./actions/formatToPdf/powerpointToPdf.operation");
|
|
27
|
+
const imageToPdf_operation_1 = require("./actions/formatToPdf/imageToPdf.operation");
|
|
28
|
+
const htmlToPdf_operation_1 = require("./actions/formatToPdf/htmlToPdf.operation");
|
|
29
|
+
const markdownToPdf_operation_1 = require("./actions/formatToPdf/markdownToPdf.operation");
|
|
30
|
+
class MorphoPdf {
|
|
31
|
+
description = {
|
|
32
|
+
displayName: 'MorphoPDF',
|
|
33
|
+
name: 'morphoPdf',
|
|
34
|
+
icon: 'file:morphopdf.svg',
|
|
35
|
+
iconColor: 'blue',
|
|
36
|
+
group: ['transform'],
|
|
37
|
+
version: 1,
|
|
38
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
39
|
+
description: 'Professional PDF processing - merge, split, convert, compress, protect & more',
|
|
40
|
+
defaults: {
|
|
41
|
+
name: 'MorphoPDF',
|
|
42
|
+
},
|
|
43
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
44
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
45
|
+
usableAsTool: true,
|
|
46
|
+
credentials: [
|
|
47
|
+
{
|
|
48
|
+
name: 'morphoPdfApi',
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
properties: [
|
|
53
|
+
descriptions_1.resourceProperty,
|
|
54
|
+
descriptions_1.documentManagementOperationProperty,
|
|
55
|
+
descriptions_1.pdfToFormatOperationProperty,
|
|
56
|
+
descriptions_1.formatToPdfOperationProperty,
|
|
57
|
+
descriptions_1.securitySigningOperationProperty,
|
|
58
|
+
descriptions_1.inputMethodProperty,
|
|
59
|
+
descriptions_1.binaryPropertyNameProperty,
|
|
60
|
+
descriptions_1.fileUrlProperty,
|
|
61
|
+
descriptions_1.fileUrlsProperty,
|
|
62
|
+
descriptions_1.outputBinaryPropertyNameProperty,
|
|
63
|
+
// Document Management parameters
|
|
64
|
+
descriptions_1.qualityProperty,
|
|
65
|
+
descriptions_1.splitModeProperty,
|
|
66
|
+
descriptions_1.rangesProperty,
|
|
67
|
+
descriptions_1.rotationAngleProperty,
|
|
68
|
+
descriptions_1.rotatePagesProperty,
|
|
69
|
+
// Organize parameters
|
|
70
|
+
descriptions_1.newPageOrderProperty,
|
|
71
|
+
// Crop parameters
|
|
72
|
+
descriptions_1.cropModeProperty,
|
|
73
|
+
descriptions_1.cropTopProperty,
|
|
74
|
+
descriptions_1.cropRightProperty,
|
|
75
|
+
descriptions_1.cropBottomProperty,
|
|
76
|
+
descriptions_1.cropLeftProperty,
|
|
77
|
+
// Watermark parameters
|
|
78
|
+
descriptions_1.watermarkTypeProperty,
|
|
79
|
+
descriptions_1.watermarkTextProperty,
|
|
80
|
+
descriptions_1.watermarkImageUrlProperty,
|
|
81
|
+
descriptions_1.watermarkPositionProperty,
|
|
82
|
+
descriptions_1.watermarkOpacityProperty,
|
|
83
|
+
descriptions_1.watermarkRotationProperty,
|
|
84
|
+
// Security & Signing parameters
|
|
85
|
+
descriptions_1.userPasswordProperty,
|
|
86
|
+
descriptions_1.ownerPasswordProperty,
|
|
87
|
+
descriptions_1.passwordProperty,
|
|
88
|
+
// Sign parameters
|
|
89
|
+
descriptions_1.signatureImageUrlProperty,
|
|
90
|
+
descriptions_1.signaturePageProperty,
|
|
91
|
+
descriptions_1.signatureXProperty,
|
|
92
|
+
descriptions_1.signatureYProperty,
|
|
93
|
+
descriptions_1.signatureWidthProperty,
|
|
94
|
+
descriptions_1.signatureHeightProperty,
|
|
95
|
+
// PDF to Format parameters
|
|
96
|
+
descriptions_1.imageFormatProperty,
|
|
97
|
+
descriptions_1.dpiProperty,
|
|
98
|
+
descriptions_1.pageRangeProperty,
|
|
99
|
+
descriptions_1.ocrForScannedProperty,
|
|
100
|
+
// Format to PDF parameters
|
|
101
|
+
descriptions_1.htmlSourceTypeProperty,
|
|
102
|
+
descriptions_1.htmlUrlProperty,
|
|
103
|
+
descriptions_1.htmlContentProperty,
|
|
104
|
+
descriptions_1.pageFormatProperty,
|
|
105
|
+
descriptions_1.landscapeProperty,
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
async execute() {
|
|
109
|
+
const items = this.getInputData();
|
|
110
|
+
const returnData = [];
|
|
111
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
112
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
113
|
+
// For merge operation, process all items at once
|
|
114
|
+
if (resource === 'documentManagement' && operation === 'merge') {
|
|
115
|
+
try {
|
|
116
|
+
const result = await merge_operation_1.executeMerge.call(this, items);
|
|
117
|
+
returnData.push(result);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
if (this.continueOnFail()) {
|
|
121
|
+
returnData.push({
|
|
122
|
+
json: { error: error.message },
|
|
123
|
+
pairedItem: { item: 0 },
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
throw error;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return [returnData];
|
|
131
|
+
}
|
|
132
|
+
// For other operations, process each item individually
|
|
133
|
+
for (let i = 0; i < items.length; i++) {
|
|
134
|
+
try {
|
|
135
|
+
let result;
|
|
136
|
+
// Document Management operations
|
|
137
|
+
if (resource === 'documentManagement') {
|
|
138
|
+
switch (operation) {
|
|
139
|
+
case 'split':
|
|
140
|
+
result = await split_operation_1.executeSplit.call(this, i);
|
|
141
|
+
break;
|
|
142
|
+
case 'compress':
|
|
143
|
+
result = await compress_operation_1.executeCompress.call(this, i);
|
|
144
|
+
break;
|
|
145
|
+
case 'rotate':
|
|
146
|
+
result = await rotate_operation_1.executeRotate.call(this, i);
|
|
147
|
+
break;
|
|
148
|
+
case 'crop':
|
|
149
|
+
result = await crop_operation_1.executeCrop.call(this, i);
|
|
150
|
+
break;
|
|
151
|
+
case 'organize':
|
|
152
|
+
result = await organize_operation_1.executeOrganize.call(this, i);
|
|
153
|
+
break;
|
|
154
|
+
case 'watermark':
|
|
155
|
+
result = await watermark_operation_1.executeWatermark.call(this, i);
|
|
156
|
+
break;
|
|
157
|
+
default:
|
|
158
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported Document Management operation: ${operation}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// PDF to Format operations
|
|
162
|
+
else if (resource === 'pdfToFormat') {
|
|
163
|
+
switch (operation) {
|
|
164
|
+
case 'pdfToWord':
|
|
165
|
+
result = await pdfToWord_operation_1.executePdfToWord.call(this, i);
|
|
166
|
+
break;
|
|
167
|
+
case 'pdfToExcel':
|
|
168
|
+
result = await pdfToExcel_operation_1.executePdfToExcel.call(this, i);
|
|
169
|
+
break;
|
|
170
|
+
case 'pdfToPowerpoint':
|
|
171
|
+
result = await pdfToPowerpoint_operation_1.executePdfToPowerpoint.call(this, i);
|
|
172
|
+
break;
|
|
173
|
+
case 'pdfToImage':
|
|
174
|
+
result = await pdfToImage_operation_1.executePdfToImage.call(this, i);
|
|
175
|
+
break;
|
|
176
|
+
default:
|
|
177
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported PDF to Format operation: ${operation}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// Format to PDF operations
|
|
181
|
+
else if (resource === 'formatToPdf') {
|
|
182
|
+
switch (operation) {
|
|
183
|
+
case 'wordToPdf':
|
|
184
|
+
result = await wordToPdf_operation_1.executeWordToPdf.call(this, i);
|
|
185
|
+
break;
|
|
186
|
+
case 'excelToPdf':
|
|
187
|
+
result = await excelToPdf_operation_1.executeExcelToPdf.call(this, i);
|
|
188
|
+
break;
|
|
189
|
+
case 'powerpointToPdf':
|
|
190
|
+
result = await powerpointToPdf_operation_1.executePowerpointToPdf.call(this, i);
|
|
191
|
+
break;
|
|
192
|
+
case 'imageToPdf':
|
|
193
|
+
result = await imageToPdf_operation_1.executeImageToPdf.call(this, i);
|
|
194
|
+
break;
|
|
195
|
+
case 'htmlToPdf':
|
|
196
|
+
result = await htmlToPdf_operation_1.executeHtmlToPdf.call(this, i);
|
|
197
|
+
break;
|
|
198
|
+
case 'markdownToPdf':
|
|
199
|
+
result = await markdownToPdf_operation_1.executeMarkdownToPdf.call(this, i);
|
|
200
|
+
break;
|
|
201
|
+
default:
|
|
202
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported Format to PDF operation: ${operation}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Security & Signing operations
|
|
206
|
+
else if (resource === 'securitySigning') {
|
|
207
|
+
switch (operation) {
|
|
208
|
+
case 'sign':
|
|
209
|
+
result = await sign_operation_1.executeSign.call(this, i);
|
|
210
|
+
break;
|
|
211
|
+
case 'protect':
|
|
212
|
+
result = await protect_operation_1.executeProtect.call(this, i);
|
|
213
|
+
break;
|
|
214
|
+
case 'unlock':
|
|
215
|
+
result = await unlock_operation_1.executeUnlock.call(this, i);
|
|
216
|
+
break;
|
|
217
|
+
default:
|
|
218
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported Security & Signing operation: ${operation}`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported resource: ${resource}`);
|
|
223
|
+
}
|
|
224
|
+
returnData.push(result);
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
if (this.continueOnFail()) {
|
|
228
|
+
returnData.push({
|
|
229
|
+
json: { error: error.message },
|
|
230
|
+
pairedItem: { item: i },
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return [returnData];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
exports.MorphoPdf = MorphoPdf;
|
|
242
|
+
//# sourceMappingURL=MorphoPdf.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MorphoPdf.node.js","sourceRoot":"","sources":["../../../nodes/MorphoPdf/MorphoPdf.node.ts"],"names":[],"mappings":";;;AAMA,+CAAuE;AAEvE,wDA+C+B;AAE/B,iCAAiC;AACjC,kFAA4E;AAC5E,kFAA4E;AAC5E,wFAAkF;AAClF,oFAA8E;AAC9E,gFAA0E;AAC1E,wFAAkF;AAClF,0FAAoF;AAEpF,gCAAgC;AAChC,6EAAuE;AACvE,mFAA6E;AAC7E,iFAA2E;AAE3E,2BAA2B;AAC3B,mFAA6E;AAC7E,qFAA+E;AAC/E,+FAAyF;AACzF,qFAA+E;AAE/E,2BAA2B;AAC3B,mFAA6E;AAC7E,qFAA+E;AAC/E,+FAAyF;AACzF,qFAA+E;AAC/E,mFAA6E;AAC7E,2FAAqF;AAErF,MAAa,SAAS;IACpB,WAAW,GAAyB;QAClC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,oBAAoB;QAC1B,SAAS,EAAE,MAAM;QACjB,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,8DAA8D;QACxE,WAAW,EAAE,+EAA+E;QAC5F,QAAQ,EAAE;YACR,IAAI,EAAE,WAAW;SAClB;QACD,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;QAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;QACnC,YAAY,EAAE,IAAI;QAClB,WAAW,EAAE;YACX;gBACE,IAAI,EAAE,cAAc;gBACpB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,UAAU,EAAE;YACV,+BAAgB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E,CAAC,CAAC;gBACpF,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC1B,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE;wBACzC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACxB,CAAC,CAAC;gBACL,CAAC;qBAAM,CAAC;oBACN,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACtB,CAAC;CACF;AAhOD,8BAgOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compress.operation.d.ts","sourceRoot":"","sources":["../../../../../nodes/MorphoPdf/actions/documentManagement/compress.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAO1E,wBAAsB,eAAe,CACnC,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA8C7B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeCompress = executeCompress;
|
|
4
|
+
const helpers_1 = require("../../shared/helpers");
|
|
5
|
+
async function executeCompress(itemIndex) {
|
|
6
|
+
const inputMethod = this.getNodeParameter('inputMethod', itemIndex);
|
|
7
|
+
const quality = this.getNodeParameter('quality', itemIndex);
|
|
8
|
+
let responseBuffer;
|
|
9
|
+
if (inputMethod === 'url') {
|
|
10
|
+
const fileUrl = this.getNodeParameter('fileUrl', itemIndex);
|
|
11
|
+
const body = { url: fileUrl, quality };
|
|
12
|
+
responseBuffer = (await helpers_1.morphoPdfApiRequest.call(this, 'POST', '/pdf/compress', body));
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
const inputFile = await helpers_1.getInputFile.call(this, itemIndex);
|
|
16
|
+
const formData = {
|
|
17
|
+
file: {
|
|
18
|
+
value: inputFile.content,
|
|
19
|
+
options: {
|
|
20
|
+
filename: inputFile.fileName,
|
|
21
|
+
contentType: inputFile.mimeType,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
quality,
|
|
25
|
+
};
|
|
26
|
+
responseBuffer = (await helpers_1.morphoPdfApiRequest.call(this, 'POST', '/pdf/compress', undefined, formData));
|
|
27
|
+
}
|
|
28
|
+
return helpers_1.prepareBinaryOutput.call(this, itemIndex, responseBuffer, 'compressed.pdf', 'application/pdf');
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=compress.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compress.operation.js","sourceRoot":"","sources":["../../../../../nodes/MorphoPdf/actions/documentManagement/compress.operation.ts"],"names":[],"mappings":";;AAOA,0CAiDC;AAvDD,kDAI8B;AAEvB,KAAK,UAAU,eAAe,CAEnC,SAAiB;IAEjB,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAW,CAAC;IAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAW,CAAC;IAEtE,IAAI,cAAsB,CAAC;IAE3B,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAW,CAAC;QACtE,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAEvC,cAAc,GAAG,CAAC,MAAM,6BAAmB,CAAC,IAAI,CAC9C,IAAI,EACJ,MAAM,EACN,eAAe,EACf,IAAI,CACL,CAAW,CAAC;IACf,CAAC;SAAM,CAAC;QACN,MAAM,SAAS,GAAG,MAAM,sBAAY,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAE3D,MAAM,QAAQ,GAA4B;YACxC,IAAI,EAAE;gBACJ,KAAK,EAAE,SAAS,CAAC,OAAO;gBACxB,OAAO,EAAE;oBACP,QAAQ,EAAE,SAAS,CAAC,QAAQ;oBAC5B,WAAW,EAAE,SAAS,CAAC,QAAQ;iBAChC;aACF;YACD,OAAO;SACR,CAAC;QAEF,cAAc,GAAG,CAAC,MAAM,6BAAmB,CAAC,IAAI,CAC9C,IAAI,EACJ,MAAM,EACN,eAAe,EACf,SAAS,EACT,QAAQ,CACT,CAAW,CAAC;IACf,CAAC;IAED,OAAO,6BAAmB,CAAC,IAAI,CAC7B,IAAI,EACJ,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crop.operation.d.ts","sourceRoot":"","sources":["../../../../../nodes/MorphoPdf/actions/documentManagement/crop.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAO1E,wBAAsB,WAAW,CAC/B,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA2D7B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeCrop = executeCrop;
|
|
4
|
+
const helpers_1 = require("../../shared/helpers");
|
|
5
|
+
async function executeCrop(itemIndex) {
|
|
6
|
+
const inputMethod = this.getNodeParameter('inputMethod', itemIndex);
|
|
7
|
+
// Get crop parameters from UI
|
|
8
|
+
const cropMode = this.getNodeParameter('cropMode', itemIndex, 'uniform');
|
|
9
|
+
const cropData = {
|
|
10
|
+
top: this.getNodeParameter('cropTop', itemIndex, 0),
|
|
11
|
+
right: this.getNodeParameter('cropRight', itemIndex, 0),
|
|
12
|
+
bottom: this.getNodeParameter('cropBottom', itemIndex, 0),
|
|
13
|
+
left: this.getNodeParameter('cropLeft', itemIndex, 0),
|
|
14
|
+
};
|
|
15
|
+
let responseBuffer;
|
|
16
|
+
if (inputMethod === 'url') {
|
|
17
|
+
const fileUrl = this.getNodeParameter('fileUrl', itemIndex);
|
|
18
|
+
const body = {
|
|
19
|
+
url: fileUrl,
|
|
20
|
+
cropMode,
|
|
21
|
+
cropData,
|
|
22
|
+
};
|
|
23
|
+
responseBuffer = (await helpers_1.morphoPdfApiRequest.call(this, 'POST', '/pdf/crop', body));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const inputFile = await helpers_1.getInputFile.call(this, itemIndex);
|
|
27
|
+
const formData = {
|
|
28
|
+
file: {
|
|
29
|
+
value: inputFile.content,
|
|
30
|
+
options: {
|
|
31
|
+
filename: inputFile.fileName,
|
|
32
|
+
contentType: inputFile.mimeType,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
cropMode,
|
|
36
|
+
cropData: JSON.stringify(cropData),
|
|
37
|
+
};
|
|
38
|
+
responseBuffer = (await helpers_1.morphoPdfApiRequest.call(this, 'POST', '/pdf/crop', undefined, formData));
|
|
39
|
+
}
|
|
40
|
+
return helpers_1.prepareBinaryOutput.call(this, itemIndex, responseBuffer, 'cropped.pdf', 'application/pdf');
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=crop.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crop.operation.js","sourceRoot":"","sources":["../../../../../nodes/MorphoPdf/actions/documentManagement/crop.operation.ts"],"names":[],"mappings":";;AAOA,kCA8DC;AApED,kDAI8B;AAEvB,KAAK,UAAU,WAAW,CAE/B,SAAiB;IAEjB,MAAM,WAAW,GAAG,IAAI,CAAC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ACnC,CAAC;QAEF,cAAc,GAAG,CAAC,MAAM,6BAAmB,CAAC,IAAI,CAC9C,IAAI,EACJ,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,CACT,CAAW,CAAC;IACf,CAAC;IAED,OAAO,6BAAmB,CAAC,IAAI,CAC7B,IAAI,EACJ,SAAS,EACT,cAAc,EACd,aAAa,EACb,iBAAiB,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.operation.d.ts","sourceRoot":"","sources":["../../../../../nodes/MorphoPdf/actions/documentManagement/merge.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAO1E,wBAAsB,YAAY,CAChC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,kBAAkB,EAAE,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAkD7B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeMerge = executeMerge;
|
|
4
|
+
const helpers_1 = require("../../shared/helpers");
|
|
5
|
+
async function executeMerge(items) {
|
|
6
|
+
const inputMethod = this.getNodeParameter('inputMethod', 0);
|
|
7
|
+
let responseBuffer;
|
|
8
|
+
if (inputMethod === 'url') {
|
|
9
|
+
// URL-based merge
|
|
10
|
+
const urls = this.getNodeParameter('fileUrls', 0);
|
|
11
|
+
if (urls.length < 2) {
|
|
12
|
+
throw new Error('At least 2 URLs are required for merging');
|
|
13
|
+
}
|
|
14
|
+
const body = { urls };
|
|
15
|
+
responseBuffer = (await helpers_1.morphoPdfApiRequest.call(this, 'POST', '/pdf/merge', body));
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
// Binary-based merge - collect all input files
|
|
19
|
+
const files = await helpers_1.getMultipleInputFiles.call(this, items);
|
|
20
|
+
if (files.length < 2) {
|
|
21
|
+
throw new Error('At least 2 PDF files are required for merging');
|
|
22
|
+
}
|
|
23
|
+
// Build multipart form data
|
|
24
|
+
const formData = {};
|
|
25
|
+
files.forEach((file, index) => {
|
|
26
|
+
formData[`file${index}`] = {
|
|
27
|
+
value: file.content,
|
|
28
|
+
options: {
|
|
29
|
+
filename: file.fileName,
|
|
30
|
+
contentType: file.mimeType,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
responseBuffer = (await helpers_1.morphoPdfApiRequest.call(this, 'POST', '/pdf/merge', undefined, formData));
|
|
35
|
+
}
|
|
36
|
+
return helpers_1.prepareBinaryOutput.call(this, 0, responseBuffer, 'merged.pdf', 'application/pdf');
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=merge.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.operation.js","sourceRoot":"","sources":["../../../../../nodes/MorphoPdf/actions/documentManagement/merge.operation.ts"],"names":[],"mappings":";;AAOA,oCAqDC;AA3DD,kDAI8B;AAEvB,KAAK,UAAU,YAAY,CAEhC,KAA2B;IAE3B,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAW,CAAC;IAEtE,IAAI,cAAsB,CAAC;IAE3B,IAAI,WAAW,KAAK,KAAK,EAAE,CAAC;QAC1B,kBAAkB;QAClB,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAa,CAAC;QAE9D,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,CAAC;QAED,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,CAAC;QACtB,cAAc,GAAG,CAAC,MAAM,6BAAmB,CAAC,IAAI,CAC9C,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,IAAI,CACL,CAAW,CAAC;IACf,CAAC;SAAM,CAAC;QACN,+CAA+C;QAC/C,MAAM,KAAK,GAAG,MAAM,+BAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAE5D,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QAED,4BAA4B;QAC5B,MAAM,QAAQ,GAA4B,EAAE,CAAC;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC5B,QAAQ,CAAC,OAAO,KAAK,EAAE,CAAC,GAAG;gBACzB,KAAK,EAAE,IAAI,CAAC,OAAO;gBACnB,OAAO,EAAE;oBACP,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,WAAW,EAAE,IAAI,CAAC,QAAQ;iBAC3B;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,cAAc,GAAG,CAAC,MAAM,6BAAmB,CAAC,IAAI,CAC9C,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,SAAS,EACT,QAAQ,CACT,CAAW,CAAC;IACf,CAAC;IAED,OAAO,6BAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organize.operation.d.ts","sourceRoot":"","sources":["../../../../../nodes/MorphoPdf/actions/documentManagement/organize.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAO1E,wBAAsB,eAAe,CACnC,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA0D7B"}
|