Skip to content

Commit

Permalink
documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cjimti committed Jul 2, 2018
1 parent 096f240 commit a3415d3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@

# txPDF

txPDF is an HTML to PDF microservice by [txn2]
[txPDF] is an HTML to PDF microservice by [txn2]. [txPDF] is built on top of the [n2pdf] container exposing an API endpoint that returns a PDF document from web based **POST** request.

Example Post Body:
```json
{
"options": {
"print_media_type": true
},
"pages": [
{
"Location": "https://www.example.com"
}
]
}
```

## Docker Use

Expand All @@ -14,6 +28,11 @@ Run the [txPDF Docker container] on your local workstation for testing. Forward
docker run --rm -p 8080:8080 -e DEBUG=true txn2/txpdf
```

## Curl Test
```bash
curl -d "@examples/days.json" -X POST http://localhost:8080/getPdf --output test.pdf
```

[txPDF] can be configured with the following environment variables:

| Variable | Default | Purpose |
Expand All @@ -29,6 +48,7 @@ docker run --rm -p 8080:8080 -e DEBUG=true txn2/txpdf
curl -d "@examples/multi-site.json" -X POST http://localhost:8080/getPdf --output test.pdf
```

[n2pdf]:https://github.com/txn2/n2pdf
[txPDF]:https://github.com/txn2/txpdf
[txn2]:https://github.com/txn2
[txPDF Docker container]:https://hub.docker.com/r/txn2/txpdf/
10 changes: 10 additions & 0 deletions examples/simple.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"options": {
"print_media_type": true
},
"pages": [
{
"Location": "https://www.example.com"
}
]
}

0 comments on commit a3415d3

Please sign in to comment.