tasks
A module that contains all Celery tasks of the converter.
Functions
convert_html_file(file_id)
: A function that convert html file to pdf file asynchronously.rename_html_file(html_file, file_id)
: A function that rename the html file.rename_output_file(output_file, file_id)
: A function that rename the output file.
convert_html_file(file_id)
Convert an HTML file to PDF asynchronously using the HtmlConverter class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_id |
str
|
The ID of the File object to be converted. |
required |
Source code in backend/api/converter/tasks.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
rename_html_file(html_file, file_id)
Rename the html file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
html_file |
str
|
the html file path |
required |
file_id |
str
|
the file id to renamed to |
required |
Returns:
Type | Description |
---|---|
str
|
The new renamed html file path |
Source code in backend/api/converter/tasks.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
rename_output_file(output_file, file_id)
Rename the output file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_file |
str
|
the old output file path |
required |
file_id |
str
|
the file id to renamed to |
required |
Returns:
Type | Description |
---|---|
str
|
The new renamed output file path |
Source code in backend/api/converter/tasks.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|