Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertMcCann committed Sep 13, 2023
1 parent 4e28a11 commit 8c2b483
Showing 1 changed file with 42 additions and 3 deletions.
45 changes: 42 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,51 @@ Send a HTML or Mustache template and recieve a PDF stream as the response.

## Install and start

### Node App
### Docker container

Navigate to quay.io/ukhomeofficedigital/html-pdf-converter to find latest tagged version this will be the image that docker will pull.

For example, if the latest tagged version v2.4.3 then this command will need to be run:

```bash
docker pull quay.io/ukhomeofficedigital/html-pdf-converter:v2.4.3
```
Once completed you can check quay.io/ukhomeofficedigital/html-pdf-converter repository is installed by running:
```bash
docker image list
```
All HOF forms run locally on port 8080 and in some cases port 8081 may also be in use; so the html-pdf-converter should be run on another port. Currently port 8082 is recommended.

```bash
docker pull quay.io/ukhomeofficedigital/html-pdf-converter
docker run -p 8080:8080 html-pdf-converter
docker run -t -i -p 8082:8080 quay.io/ukhomeofficedigital/html-pdf-converter:v2.4.3
```

Observe following in terminal:

```bash
2023-09-13T11:18:07.061Z - info: Listening on localhost:8080
```

Note: The terminal will say that the application is listening on port 8080, however you can verify which port the html-pdf-converter container is using by running:

```bash
docker ps -a
```

The HOF form service that is using the html to pdf converter will need to be run locally too. The service will need the following env variable:

- `PDF_CONVERTER_URL`: If you are running a local PDF converter this is the url and port it is running on. This URL should be in the format `PDF_CONVERTER_URL=http://localhost:<PORT>/convert`.

- In this example the PDF_CONVERTER_URL should look like `PDF_CONVERTER_URL=http://localhost:8082/convert`


Upon a successful html to pdf conversion the output should look something like this:

```bash
2023-09-12T15:31:30.249Z - info: status=201, method=POST, url=/convert, response_time=392, content_length=39644
```


## Development

```bash
Expand Down

0 comments on commit 8c2b483

Please sign in to comment.