@@ -15,8 +15,7 @@ mode on and off yields different interactions with the fill method.
15
15
16
16
#### Parameters:
17
17
18
- * ** template** - a byte stream of the unfilled PDF form template. Usually generated
19
- by Python IO's ` .read() ` method.
18
+ * ** template** - a file path, file object, or ` bytes ` stream of the unfilled PDF form template.
20
19
21
20
* ** simple_mode** - a simple mode PyPDFForm object only allows filling data without specifying
22
21
details like font size. Turning simple mode on also allows leaving PDF editable
@@ -48,13 +47,12 @@ This operation can also be done by assignment operator `+=`.
48
47
49
48
### ** draw_image** (* image, page_number, x, y, width, height, rotation=0* )
50
49
51
- The draw image method takes an image byte stream and draws it
50
+ The draw image method takes an image and draws it
52
51
on the specified page, coordinates with specified resolutions and rotation angle.
53
52
54
53
#### Parameters:
55
54
56
- * ** image** - bytes, a byte stream of the image. Usually generated by Python IO's
57
- ` .read() ` method.
55
+ * ** image** - a file path, file object, or ` bytes ` stream of the image.
58
56
59
57
* ** page_number** - integer, page number of which the image will be drawn on.
60
58
@@ -121,7 +119,7 @@ Its values currently support the following:
121
119
3) An ` integer ` , which will select the corresponding option of a group of radio buttons with the same name.
122
120
NOTE: Only groups of radio buttons with the same name are supported. If there is only one
123
121
radio button with a name, please consider using ` checkbox ` instead.
124
- 4) A valid image ` bytes ` stream, which will be drawn on the corresponding ` image ` element.
122
+ 4) A valid image file path, file object, or ` bytes ` stream, which will be drawn on the corresponding ` image ` element.
125
123
126
124
* ** editable** - only available if ` simple_mode ` is ` True ` , enabling this will allow the filled PDF to be still
127
125
editable. NOTE: ` image ` elements that are filled via the ` fill ` method will NOT be editable even if this is ` True ` .
@@ -130,7 +128,7 @@ editable. NOTE: `image` elements that are filled via the `fill` method will NOT
130
128
131
129
Returns the ` stream ` . This method allows the implementation of PyPDFForm to behave like a file object.
132
130
133
- ### ** register_font** (* font_name, ttf_stream * )
131
+ ### ** register_font** (* font_name, ttf_file * )
134
132
135
133
This class method takes a TTF font file stream and register it with the ` font_name ` specified.
136
134
Registered fonts can then be used by any instance of object.
@@ -140,7 +138,7 @@ Registered fonts can then be used by any instance of object.
140
138
* ** font_name** - a string of which the font will be registered as. Registered fonts can be referenced and
141
139
used via this name.
142
140
143
- * ** ttf_stream ** - a byte stream of the ttf font file.
141
+ * ** ttf_file ** - a file path, file object, or ` bytes ` stream of the ttf font file.
144
142
145
143
### ** simple_mode** = * True*
146
144
@@ -149,7 +147,7 @@ like font size.
149
147
150
148
### ** stream** = * b""*
151
149
152
- A byte object which holds the stream with the current state of the PDF form. This can be used by
150
+ A ` bytes ` object which holds the stream with the current state of the PDF form. This can be used by
153
151
Python IO to ` .write ` to another destination.
154
152
155
153
## Element Object
0 commit comments