Renders the barcode and writes it to the file like object `fp`. :param fp: Object to write the raw data in. :param options: The same as in `self.render`. :param text: Text to render under the barcode.
(
self,
fp: BinaryIO,
options: dict | None = None,
text: str | None = None,
)
| 78 | return self.writer.save(filename, output) |
| 79 | |
| 80 | def write( |
| 81 | self, |
| 82 | fp: BinaryIO, |
| 83 | options: dict | None = None, |
| 84 | text: str | None = None, |
| 85 | ) -> None: |
| 86 | """Renders the barcode and writes it to the file like object |
| 87 | `fp`. |
| 88 | |
| 89 | :param fp: Object to write the raw data in. |
| 90 | :param options: The same as in `self.render`. |
| 91 | :param text: Text to render under the barcode. |
| 92 | """ |
| 93 | output = self.render(options, text) |
| 94 | self.writer.write(output, fp) |
| 95 | |
| 96 | def render(self, writer_options: dict | None = None, text: str | None = None): |
| 97 | """Renders the barcode using `self.writer`. |