0

I am new to this library. I want to create "newspaper lookalike" page with this library.

I want to add headline, lead, text and image to the pdf file. Text is very long so i want to use MultiColumnLayout. I also want to set up the margins and spacing between the columns. Are there any explanations, code snippets for this? When every I copy/paste the code that I find on the internet, I get some kind of error, like code is updated.

I have this code, but I do not have a clue how to add text, margins, column spacing or even image:

from borb.pdf import Document
from borb.pdf import Page
from borb.pdf import PageLayout
from borb.pdf import MultiColumnLayout

# create an empty PDF
Document = Document()

# create an empty Page
Page = Page()
doc.add_page(page)

# set a PageLayout
PageLayout = MultiColumnLayout(page, 
                               column_widths=[w - Decimal(100)], 
                               margin_top=Decimal(50), 
                               margin_right=Decimal(50),
                               margin_bottom=Decimal(50),
                               margin_left=Decimal(50),
                                )
taga
  • 3,537
  • 13
  • 53
  • 119

0 Answers0