Skip to content

Commit d73f0f1

Browse files
author
Chris Wiechmann
authored
Merge pull request #172 from wickedest/master
Add a PDF flow-node for generating and parsing PDF files
2 parents 49b6a9e + 6907084 commit d73f0f1

File tree

10 files changed

+11239
-0
lines changed

10 files changed

+11239
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: PDF Flow-Node
2+
3+
on:
4+
push:
5+
paths:
6+
- 'api-builder-plugin-fn-pdf/**'
7+
pull_request:
8+
paths:
9+
- 'api-builder-plugin-fn-pdf/**'
10+
release:
11+
types:
12+
- published
13+
14+
defaults:
15+
run:
16+
working-directory: api-builder-plugin-fn-pdf
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
node-version: [10.x, 12.x, 14.x]
24+
steps:
25+
- uses: actions/checkout@v1
26+
- name: Use Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
- name: npm install, build, and test
31+
run: |
32+
npm ci
33+
npm run build --if-present
34+
npm test
35+
36+
publish-gpr:
37+
if: contains(github.event.release.tag_name, 'plugin-fn-pdf')
38+
env:
39+
CI: true
40+
needs: build
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v1
44+
- uses: actions/setup-node@v1
45+
with:
46+
node-version: 12
47+
registry-url: https://npm.pkg.github.com/
48+
scope: '@Axway-API-Builder-Ext'
49+
- name: Publish to GitHub package repo
50+
env:
51+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
52+
run: |
53+
npm ci
54+
npm publish
55+
56+
publish-npm:
57+
env:
58+
CI: true
59+
needs: [build, publish-gpr]
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v1
63+
- uses: actions/setup-node@v1
64+
with:
65+
node-version: 12
66+
registry-url: https://registry.npmjs.org/
67+
- name: Publish to NPM package repo
68+
env:
69+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
70+
run: |
71+
npm ci
72+
echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" > ~/.npmrc
73+
npm publish --access public
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# @axway/api-builder-plugin-fn-pdf
2+
3+
PDF flow-node for [API Builder](https://docs.axway.com/bundle/api-builder/page/docs/index.html) provides functions to generate and parse PDF files.
4+
5+
## Install
6+
7+
Install within an API Builder project using:
8+
9+
```bash
10+
npm install @axway-api-builder-ext/api-builder-plugin-fn-pdf
11+
```
12+
13+
## Methods
14+
15+
The following sections provide details of the PDF flow-node methods.
16+
17+
### Generate PDF from markdown
18+
19+
Generates PDF from markdown text using https://www.npmjs.com/package/md-to-pdf.
20+
21+
#### Parameters
22+
23+
| Parameter | Type | Description | Configuration selection | Required |
24+
| --- | --- | --- | --- | --- |
25+
| Markdown | string | A github flavored markdown string. | Selector, String | Yes |
26+
27+
#### Outputs
28+
29+
| Output | Type | Description | Save output value as: |
30+
| --- | --- | --- | --- |
31+
| Next | any | The PDF data. | `$.pdf` |
32+
| Error | any | The PDF generation failed. | `$.error` |
33+
34+
### Parse PDF data
35+
36+
Parses a PDF using https://www.npmjs.com/package/pdf-parse.
37+
38+
#### Parameters
39+
40+
| Parameter | Type | Description | Configuration selection | Required |
41+
| --- | --- | --- | --- | --- |
42+
| Data | Buffer | A PDF Buffer. | Selector, Object | Yes |
43+
44+
#### Outputs
45+
46+
| Output | Type | Description | Save output value as: |
47+
| --- | --- | --- | --- |
48+
| Next | any | The parsed PDF. | `$.parsedPdf` |
49+
| Error | any | PDF parsing failed. | `$.error` |

0 commit comments

Comments
 (0)