Skip to content

Commit 78d8111

Browse files
committed
django project replaced with only script and added a README.md
1 parent 2b40f82 commit 78d8111

File tree

18 files changed

+49
-277
lines changed

18 files changed

+49
-277
lines changed
File renamed without changes.

PDF-rotation-API/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Rotate PDF Endpoint
2+
3+
This API endpoint allows you to rotate a specific page of a PDF file. It uses the PyPDF2 library to perform the rotation.
4+
5+
## API Endpoint
6+
7+
### Endpoint URL
8+
9+
```
10+
POST /rotate_pdf
11+
```
12+
13+
### Request Parameters
14+
15+
- `details`: An object containing the rotation details.
16+
- `page` (integer): The page number to rotate.
17+
- `degree` (integer): The rotation angle in degrees.
18+
19+
- `file`: The PDF file to rotate.
20+
21+
### Response
22+
23+
The API response will include the following:
24+
25+
- `response` (string): A message indicating whether the PDF rotation was successful.
26+
27+
- `path` (string): The path of the rotated PDF file.
28+
29+
### Implementation Steps
30+
31+
1. Read the input rotation details and the PDF file.
32+
33+
2. Use the PyPDF2 library to open the PDF file.
34+
35+
3. Create a new PDF writer object.
36+
37+
4. Get the specified page from the PDF.
38+
39+
5. Rotate the page using the `rotateClockwise` method and the specified rotation degree.
40+
41+
6. Add the rotated page to the PDF writer.
42+
43+
7. Write the output PDF file using the PDF writer.
44+
45+
8. Close the output file.
46+
47+
9. Return the API response with the message indicating the success of the rotation and the path of the rotated PDF file.
48+
49+
That's it! With these implementation steps, you can rotate a specific page of a PDF file using this API endpoint.
File renamed without changes.

PDF-rotation-API/employees/__init__.py

Whitespace-only changes.

PDF-rotation-API/employees/admin.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

PDF-rotation-API/employees/apps.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

PDF-rotation-API/employees/migrations/0001_initial.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

PDF-rotation-API/employees/migrations/0002_alter_employee_department.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

PDF-rotation-API/employees/migrations/__init__.py

Whitespace-only changes.

PDF-rotation-API/employees/models.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)