views¶
Functions
- intranet.apps.printing.views.check_page_range(page_range: str, max_pages: int) int | None [source]¶
Returns the number of pages included in the range, or None if it is an invalid range.
- Parameters:
page_range – The page range as a string, such as “1-5” or “1,2,3”.
max_pages – The number of pages in the submitted document. If the number of pages in the given range exceeds this, it will be considered invalid.
- Returns:
The number of pages in the range, or None if it is an invalid range.
- intranet.apps.printing.views.convert_pdf(tmpfile_name: str, cmdname: str = 'ps2pdf') str | None [source]¶
- intranet.apps.printing.views.convert_soffice(tmpfile_name: str) str | None [source]¶
Converts a doc or docx to a PDF with soffice.
- Parameters:
tmpfile_name – The path to the file to print.
- Returns:
The path to the converted file. If it fails, false.
- intranet.apps.printing.views.get_printers() Dict[str, List[str]] [source]¶
Returns a dictionary mapping name:description for available printers.
This requires that a CUPS client be configured on the server. Otherwise, this returns an empty dictionary.
- Returns:
[description,alerts] for available printers.
- Return type:
A dictionary mapping name
Exceptions
|
An error occurred while printing, but it was due to invalid input from the user and is not worthy of a |
|
An error occurred while accessing the cache to rate limit a user |
|
An error occurred because the user exceeded the printing rate limit |