Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
django project replaced with only script and added a README.md
  • Loading branch information
alwenpy committed Jun 30, 2023
commit 78d81111d76994e9d65cde508f8ebcebb0d9817e
File renamed without changes.
49 changes: 49 additions & 0 deletions PDF-rotation-API/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Rotate PDF Endpoint

This API endpoint allows you to rotate a specific page of a PDF file. It uses the PyPDF2 library to perform the rotation.

## API Endpoint

### Endpoint URL

```
POST /rotate_pdf
```

### Request Parameters

- `details`: An object containing the rotation details.
- `page` (integer): The page number to rotate.
- `degree` (integer): The rotation angle in degrees.

- `file`: The PDF file to rotate.

### Response

The API response will include the following:

- `response` (string): A message indicating whether the PDF rotation was successful.

- `path` (string): The path of the rotated PDF file.

### Implementation Steps

1. Read the input rotation details and the PDF file.

2. Use the PyPDF2 library to open the PDF file.

3. Create a new PDF writer object.

4. Get the specified page from the PDF.

5. Rotate the page using the `rotateClockwise` method and the specified rotation degree.

6. Add the rotated page to the PDF writer.

7. Write the output PDF file using the PDF writer.

8. Close the output file.

9. Return the API response with the message indicating the success of the rotation and the path of the rotated PDF file.

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.
Empty file.
3 changes: 0 additions & 3 deletions PDF-rotation-API/employees/admin.py

This file was deleted.

6 changes: 0 additions & 6 deletions PDF-rotation-API/employees/apps.py

This file was deleted.

32 changes: 0 additions & 32 deletions PDF-rotation-API/employees/migrations/0001_initial.py

This file was deleted.

This file was deleted.

Empty file.
10 changes: 0 additions & 10 deletions PDF-rotation-API/employees/models.py

This file was deleted.

3 changes: 0 additions & 3 deletions PDF-rotation-API/employees/tests.py

This file was deleted.

3 changes: 0 additions & 3 deletions PDF-rotation-API/employees/views.py

This file was deleted.

22 changes: 0 additions & 22 deletions PDF-rotation-API/manage.py

This file was deleted.

Empty file.
16 changes: 0 additions & 16 deletions PDF-rotation-API/rotatepdf/asgi.py

This file was deleted.

124 changes: 0 additions & 124 deletions PDF-rotation-API/rotatepdf/settings.py

This file was deleted.

23 changes: 0 additions & 23 deletions PDF-rotation-API/rotatepdf/urls.py

This file was deleted.

16 changes: 0 additions & 16 deletions PDF-rotation-API/rotatepdf/wsgi.py

This file was deleted.