# Features — nodehtmltopdf

Evidence date: 2026-10-08. Revision: `master` `dc92bed` (2022-02-09).

The README has a table-of-contents entry "Features" and no Features section. Status below is from `index.js`, `index_wit SM.js`, `SecretsManager.js`, `config.js`, `package.json`, `README.md`, and git history. AWS key values are omitted.

## Current features

| Feature | Status | Where |
|---|---|---|
| Express HTTP server on port 8080 | Current | `index.js`. Port moved from 3000 to 8080 in `eacf1df` |
| `POST /htmltopdf` renders `req.body.html` | Current since `22e7404` | `index.js` |
| Random `.pdf` filename | Current since `9025de3` | `` Math.random().toString(36).slice(2) `` in `index.js` |
| html-pdf options `format: 'Letter'` | Current since `9025de3` | `index.js`. `pagesize` / `a4` is computed and unused |
| Write the PDF in the process working directory | Current | `pdf.create(...).toFile(filename, ...)` |
| Answer `{ filename, path }` before render finishes | Current since `9025de3` | `res.send(result)` after `pdf.create`, not inside the callback |
| Response URL on `tmt-pmf-prod-invoices` in `eu-west-1` | Current | `index.js`. Host changed in `c575fc2`. Upload bucket caught up in `4ae97fd` |
| S3 upload of the raw file bytes | Current since `fed7c50` | `S3.upload` in `index.js`. Before that, `Body` was `JSON.stringify` of the bytes |
| Upload parameter `contentType: 'application/pdf'` | Current since `fed7c50` | `index.js`. SDK property `ContentType` is not the key in this object |
| ACL `public-read` left commented out | Current since `b62094a` | `index.js` |
| Credentials from `./cred.json` | Current again since `dc92bed` | `AWS.config.loadFromPath('./cred.json')`. Region value `eu-west-1`. Keys omitted |
| `GET /` logs `PMF PDF Generator` and echoes `req.body` | Current | `index.js`. Absent from `9025de3`. Present by `c575fc2` |
| `POST /pdf` echoes `req.body` and does not render | Current since `9025de3` | `index.js` |
| CORS middleware with no options | Current since `9025de3` | `app.use(cors())` |
| JSON and urlencoded body parser | Current since `9025de3` | `body-parser` in `index.js` |
| `config.js` bucket name `tmt-pmf-prod-invoices` and a `hewer` logger | Current as a module. Not read by the handlers | `config.js`. Bucket string updated in `cd53ca0` |
| `SecretsManager.getSecret` | Current as a module. Not called by `index.js` | `SecretsManager.js`, added in `24d9561` as `secretssManager.js`, renamed in `fea08ae` |
| Alternate process `index_wit SM.js` | Current as a file. Not `npm start` | Added in `dc92bed` |
| npm package `htmlpdfapi` 1.0.0, `npm start` = `node index.js` | Current | `package.json` |
| `npm test` exits 1 with "no test specified" | Current since `9025de3` | `package.json` |
| `npm run deploy` runs a missing `build` script, then `start` | Current | `package.json` |
| Dependencies `html-pdf` 3.0.1, `express` 4.17.1, `aws-sdk` 2.1072.0, `phantomjs-prebuilt` 2.1.4, `pm2` 5.1.2 | Current in the lockfile | `package-lock.json` |
| README install: Node 16, PM2, system PhantomJS 2.1.1, font packages | Current as documentation since `24d9561` | `README.md` |

## Not wired into the running entry

| Feature | Status | Where |
|---|---|---|
| Load secret `pmf-prod-s3-user` at listen | Present only in `index_wit SM.js` | Reverted out of `index.js` by `dc92bed` |
| Upload bucket taken from `Invoice_Bucket` | Present only in `index_wit SM.js` | Same revert. `index.js` hardcodes the bucket |
| `hewer` logger | Constructed in `config.js`. No call to `config.logger` | `config.js` |
| `wkhtmltopdf` and `memorystream` | In `package.json` since `9025de3`. No `require` in application source | `package.json` |
| `phantomPath` pointing at `./node_modules/phantomjs/bin/phantomjs` | Commented out | `index.js` |
| `pagesize` request field | Assigned, never passed to `html-pdf` | `index.js` |
| `req.body.data` | Assigned, never read | `index.js` |

## Removed or reverted

| Feature | When | Evidence |
|---|---|---|
| Listen port 3000 and log `Hello world app listening` | Replaced in `eacf1df` | `server.js` at `9025de3` |
| PDF body hardcoded to `<b>hello world</b>` | Replaced in `22e7404` | `index.js` before that commit. The handler already required `req.body.html` to be truthy |
| S3 body `JSON.stringify(data, null, 2)` | Replaced in `fed7c50` | Upload params at `9025de3` |
| Bucket and URL host `pmf-invoices` | Replaced in `eacf1df` | `9025de3` |
| Bucket and URL host `pmf-development-invoices` | URL host replaced in `c575fc2`. Upload bucket replaced in `4ae97fd`. `config.js` bucket replaced in `cd53ca0` | `eacf1df`, then those three commits |
| `ACL: 'public-read'` | Commented out in `b62094a` ("update acl to private") | `index.js`. It had been added in `3e07698` ("update web accessable pdf") |
| Secrets Manager as the credential source of `index.js`, and deletion of `cred.json` | Reverted in `dc92bed` ("revert previous changes") | `24d9561` removed `cred.json` and loaded `pmf-prod-s3-user`. `6d48adb` and `8b0e7b5` moved that load. `dc92bed` restored `cred.json` and wrote the attempt to `index_wit SM.js` |
| Commented `/tmp/${filename}` output path | Present in `9025de3`. Not in `index.js` at HEAD | Early `index.js` / `server.js` |

At `c575fc2` the response URL used `tmt-pmf-prod-invoices` while `S3.upload` still used `pmf-development-invoices`. `4ae97fd` made the upload bucket match the URL. Both are `tmt-pmf-prod-invoices` at HEAD.

## Planned or in development

No issue tracker, branch, or TODO marks a planned feature. The secrets-manager file is leftover from a revert, not an open branch.

The README contents list includes "Features" and the anchor `#features`. The document has no such heading.

## Deprecated

Nothing is marked deprecated. `new Buffer` in `SecretsManager.js` is the Node API that Node 16 warns about. The README install uses Node 16. **Inferred** from those two facts. The running entry does not call `getSecret`.

## Scan-host files that are not features in git

`sonar-project.properties` and `sonarqube_scan.bat` were listed when this onboarding issue was created. They are not in `git ls-tree` at `dc92bed` and they do not appear in history. They are not a SonarQube integration of this revision.
