(20251114) Ready to start API testing.

This commit is contained in:
2025-11-14 18:20:54 +05:30
parent 6e19717e0b
commit 5ac5ad9ece
31 changed files with 32194 additions and 15 deletions
+4 -4
View File
@@ -230,7 +230,7 @@ class PDFMaker:
"""
Download a file from a URL.
:param url: The URL to download the file from.
:param url: The URL to downloads the file from.
:param follow_redirects: Whether, or not, to follow along with any redirects when downloading the file.
:return: The downloaded file or None.
"""
@@ -458,7 +458,7 @@ class PDFMaker:
"""
Download a font from a URL and then register it for use.
:param name: The name you would later refer to the font by.
:param url: The URL to download the font from.
:param url: The URL to downloads the font from.
:param follow_redirects: Whether, or not, to follow along with any redirects when downloading the file.
:return: True if registered, else False.
"""
@@ -719,7 +719,7 @@ class PDFMaker:
"""
Asynchronously downloads an image and returns it as a PIL object.
Use this instead of just passing the URL to 'draw_image' for better efficiency.
:param url: [str] The URL to download the image from.
:param url: [str] The URL to downloads the image from.
:param follow_redirects: [bool] Whether, or not, to follow redirect URLs when downloading the file.
:param as_pil: [bool] If True, a PIL object will be returned, else a PNG file will be returned in RAM (BytesIO).
:param format: [str] The type of output file that you want. Not applicable for PIL objects.
@@ -1369,7 +1369,7 @@ class PDFMaker:
width = end_x - start_x
height = end_y - start_y
# In case the image is passed as a URL, we try to download it and open it as a PIL object:
# In case the image is passed as a URL, we try to downloads it and open it as a PIL object:
if isinstance(image, str):
if image.startswith("https://") or image.startswith("http://"):
image = Image.open(io.BytesIO(requests.get(image).content))