Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhanmirza committed Jan 12, 2024
1 parent 9527c95 commit 5b3ad1f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# SpringBooTex
Programmatic Document Generation as a REST service. PDFs are rendered using LaTeX and JSON.

SpringBooTex is PDF Generator REST Service which can be deplpyed out of the box. It can generate PDFs from LaTex and HTML Templates. It supports variable and file embeddings.

Under the hood, it uses [pdfTeX / pdfLaTeX](https://tug.org/applications/pdftex) to create a PDF from a .tex file. For generating PDFs from HTML templates it uses [openhtmltopdf](https://github.com/danfickle/openhtmltopdf) and Thymeleaf.

## Getting Started
You can download the source code for SpringBooTex by running `git clone github.com/shuhanmirza/SpringBooTex` in your terminal.
After that you can run `docker-compose up --build`.

SpringBooTex will run as an REST service by default on port 10800;

### Generating PDFs
PDF's are generated by sending an HTTP POST request to the endpoint "/api/generate-pdf" with a JSON payload:
```
{
"templateType": "LATEX | HTML",
"templateSourceType": "BASE64",
"templateSource": "TEMPLATE_SOURCE",
"stringMap": { KEY_VALUE_MAP },
"listMap" : { KEY_LIST_MAP },
"fileUrlMap": { KEY_FILE_MAP },
"responseType": "JSON | OCTET_STREAM | PDF"
}
```

#### Example: Generating a PDF from latex template

https://github.com/shuhanmirza/SpringBooTex/blob/9527c95cc7a7d11a53784f0b2071b6f9c7fcc679/Doc/example.tex


## Contributing
Please!

## Inspiration
- [LaTTe](https://github.com/raphaelreyna/latte)
1 change: 1 addition & 0 deletions SpringBooTex/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
server.port=10800
spring.application.name=SpringBooTex
spring.thymeleaf.check-template-location=false
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ services:
restart: unless-stopped
container_name: "springbootex"
ports:
- "8080:8080"
- "10800:10800"


0 comments on commit 5b3ad1f

Please sign in to comment.