I think borb
is pretty amazing for generating PDFs with Python
.
I'd love to use borb
to create documents to print on a thermal printer (fixed width, endless height of document). The documents have messages of different length thus the height of the document would need to be adjusted every time (so no blank space gets printed after the message).
Is there a way to determine the size/height of the content and to resize the page accordingly in borb?
disclaimer: I am the author of
borb
.The PDF specification explicitly states a maximum page width/height. So from that point of view, you will not be able to go above those limits.
Now to answer your other question, you can determine the width and height of a piece of content in
borb
by adding it to a (dummy)Page
.