jorisschellekens / borb

borb is a library for reading, creating and manipulating PDF files in python.
https://borbpdf.com/
Other
3.4k stars 147 forks source link

Quick questions about borb features #148

Closed survtur closed 1 year ago

survtur commented 1 year ago

I'm looking for library to create PDF and I just find out that borb exists. I saw borb-examples document but some questions stays unclear for me. Could you please tell me if borb allows to:

  1. Does borb allows to make some kind of priority list for fonts that should be used in paragraph? To act the same way browsers do it - if some character or emoji not in first font, then take this character from the second font, then third etc.

  2. Does it support SVGinOT fonts with color emoji?

  3. Does it works well with emoji sequences (zwj-combo, color skins and other modifiers)?

  4. Are there a way to put image in particular coordinates?

  5. Are there a way to put text block with few paragraps with certain font-size and check is it fit or not?

  6. Use bold/italic/underline/strikethrough/subscript/superscript font effects? Is it the same easy way as HTML?

  7. Is it possible just use html to format text?

jorisschellekens commented 1 year ago
  1. Yes and no. In the most common usecase, you'd create a Paragraph and you'd have to specify the Font upfront. However, the code in HTMLToPDF takes a typing.List[Font] and tries them sequentially.

  2. I don't know. I haven't tried that yet.

  3. I don't know. I haven't tried that yet.

  4. Yes. The examples contain code snippets that place a LayoutElement at exact coordinates.

  5. Normally borb gives you an assert if content does not fit in its bounding box. You could wrap a try/except around this and create your own method based on that.

  6. Bold and italic are supported. Underline, superscript and subscript are not (yet).

  7. You can convert HTML to a LayoutElement.