Stirling-PDF/README.md

159 lines
6.8 KiB
Markdown
Raw Normal View History

# StirlingPDF rewrite
This is the development repository for the new StirlingPDF backend. With the power of JS, WASM & GO this will provide almost all functionality SPDF can do currently directly on the client. For automation purposes this will still provide an API to automate your workflows.
2024-10-04 19:34:26 +02:00
![alt text](https://media.discordapp.net/attachments/1174462312904663120/1272615545719619674/image.png?ex=6700d5d6&is=66ff8456&hm=3e36a0c2214f2de07ba4ff4833f86aed5f2f3447f61fe80f5396654b202139b8&=&format=webp&quality=lossless)
This image is here to reflect current progress and will be updated accordingly.
2023-10-20 00:10:03 +02:00
## Try the new API!
[![Run in Postman](https://run.pstmn.io/button.svg)](https://documenter.getpostman.com/view/30633786/2s9YRB1Wto)
## Understanding Workflows
2023-10-20 02:10:03 +02:00
Workflows define how to apply operations to a PDF, including their order and relations with eachother.
2023-10-20 00:10:03 +02:00
Workflows can be created via the web-ui and then exported or, if you want to brag a bit, you can create the JSON object yourself.
### Basics
To create your own, you have to understand a few key features first. You can also look at more examples our github repository.
2023-10-22 18:04:35 +02:00
```json
2023-10-20 00:10:03 +02:00
{
"outputOptions": {
"zip": false
},
"actions": [
2023-10-20 00:10:03 +02:00
{
"type": "extract",
"values": {
"pageIndexes": [0, 2]
2023-10-20 00:10:03 +02:00
},
"actions": []
2023-10-20 00:10:03 +02:00
}
]
}
```
The workflow above will extract the first (p\[0\]) and third (p\[2\]) page of the document.
You can also nest workflows like this:
2023-10-22 18:04:35 +02:00
```json
2023-10-20 00:10:03 +02:00
{
"outputOptions": {
"zip": false
},
"actions": [
2023-10-20 00:10:03 +02:00
{
"type": "extract",
"values": {
"pageIndexes": [0, 2]
2023-10-20 00:10:03 +02:00
},
"actions": [
2023-10-20 00:10:03 +02:00
{
"type": "impose",
"values": {
"nup": 2, // 2 pages of the input document will be put on one page of the output document.
2023-10-20 00:10:03 +02:00
"format": "A4L" // A4L -> The page size of the Ouput will be an A4 in Landscape. You can also use other paper formats and "P" for portrait output.
},
"actions": []
2023-10-20 00:10:03 +02:00
}
]
}
]
}
```
If you look at it closely, you will see that the extract operation has another nested operation of the type impose. This workflow will produce a PDF with the 1st and 2nd page of the input on one single page.
### Advanced
If that is not enought for you usecase, there is also the possibility to connect operations with eachother.
You can also do different operations to produce two different output PDFs from one input.
If you are interested in learning about this, take a look at the Example workflows provided in the repository, ask on the discord, or wait for me to finish this documentation.
2023-10-19 19:46:23 +02:00
## Features
2023-10-22 18:04:35 +02:00
### Rewrite Roadmap
2023-10-19 19:46:23 +02:00
2024-10-04 19:34:26 +02:00
* [X] Client side PDF-Manipulation
* [X] Workflows
* [X] passportjs backend (auth)
* [ ] Auth in frontend
2023-10-22 18:04:35 +02:00
* [ ] Feature equivalent with S-PDF v1
* [ ] Stateful UI
* [ ] Node based editing of Workflows
2023-10-19 19:46:23 +02:00
### Functions
Current functions of spdf and their progress in this repo.
2024-10-04 19:34:26 +02:00
#### PDF Functions
| Status | Feature | Description |
| ------ | -------------------------------------------------- | ----------- |
| ✔️ | arrange | |
| ✔️ | extract | |
| ✔️ | impose | |
| ✔️ | merge | |
| ✔️ | remove blank | |
| ✔️ | remove | |
| ✔️ | rotate pages | |
| ✔️ | scale content | |
| ✔️ | scale pages | |
| ✔️ | split by preset | |
| ✔️ | split by index | |
| ✔️ | update metadata | |
| ✔️ | pdf to single large page | |
| 🚧 | remove annotations | |
| 🚧 | flatten | |
| 🚧 | overlay pdfs | |
| 🚧 | compress | |
| 🚧 | change permissions | |
| 🚧 | pdf to pdf/a | |
| 🚧 | add page numbers | |
| 🚧 | add image | |
| 🚧 | add watermark | |
| 🚧 | auto rename | |
| 🚧 | add stamp | |
| ❌ | repair | |
| ❌ | sign with cert | |
| ❌ | ocr | |
| ❌ | auto split by size/count (+split by preset) | |
| ❌ | split pdfs by sections/chapters (+split by preset) | |
| ❌ | adjust colors/contrast | |
| ❌ | adjust colors/contrast | |
| ❌ | sanitize | |
| ❌ | sign | |
| ❌ | basic text editing | |
| ❌ | auto redact | |
#### Generic Filetype (Filetypes are not supported by workflows yet. Coming Soon™)
| Status | Feature | Description |
| ------ | ------------------- | ----------- |
2024-10-04 19:34:26 +02:00
| 🚧 | image to pdf | |
| 🚧 | pdf to image | |
| 🚧 | extract images | |
| 🚧 | show javascript | |
| ❌ | convert file to pdf | |
| ❌ | pdf to word | |
| ❌ | pdf to presentation | |
| ❌ | pdf to rtf | |
| ❌ | pdf to html | |
| ❌ | pdf to xml | |
| ❌ | url/website to pdf | |
| ❌ | markdown to pdf | |
| ❌ | pdf to csv | |
| ❌ | get all info | |
| ❌ | compare | |
✔️: Done, 🚧: Possible with current Libraries, ❌: Planned Feature
## Contribute
2024-10-04 19:34:26 +02:00
For initial instructions look at [CONTRIBUTE.md](./CONTRIBUTE.md)