Comments (2)
Hi @sheneeb, it's great you are using the library!
For this you can use a table in the footer like this:
from random import randint
from pdfme import build_pdf
char = lambda: chr(randint(97, 122))
word = lambda low=2, high=10: ''.join(char() for _ in range(randint(low, high)))
text = lambda length, low=2, high=10: ' '.join(word(low, high) for _ in range(length))
document = {
"style": {"text_align": "j"},
"running_sections": {
"footer": {
"x": "left", "y": 800, "height": "bottom",
"style": {"text_align": "c"},
"content": [
{
"style": {"border_width": 0, "cell_margin": 0},
"borders": [
{"pos": "h0;:", "width": 0.5}
],
"table": [[
{".": ["Report Date: ", {".i": "31-Dec-21"}]},
{".": ["Page ", {"var": "$page"}]},
{".": ["Internal Audited by:"]}
]]
}
]
}
},
"sections": [
{
"running_sections": ["footer"],
"content": [{".": text(1000)}]
}
]
}
with open('document.pdf', 'wb') as f:
build_pdf(document, f)
In the table's dict I'm including a style
key with a border_width
of 0 to make all of the lines in the table desappear and cell_margin
of 0 to reduce the margin of the cells, to make the text closer to the lines.
Later in table's borders
list key I added a dict to make the top border different to the default one I set in border_width
. For more information on how to override the default border and fill configuration set in table's style
go to https://pdfme.readthedocs.io/en/latest/modules/table.html#pdfme.table.PDFTable .
from pdfme.
Thank you for your quick response , your active support is greatly appreciated.
from pdfme.
Related Issues (20)
- Hexagesimal colors not working
- Running the example causes error HOT 1
- import image to table HOT 1
- how to set the page orientation to landscape
- Image on Header is not working HOT 1
- how to add pandas dataframe data dynamically with dynamic cell width HOT 2
- overlapping header with section data HOT 3
- how to remove space between two table and align one after another HOT 1
- how to change the header for the same section based on the page number HOT 1
- Example of drawing a line in a PDF
- page break if the table row data crosses to next page and start the same row on the next page HOT 1
- Typographer’s apostrophe (’) in strings leads to a KeyError: '’' in fonts.py / get_text_width() HOT 1
- Couldn't process image on BytesIO image HOT 5
- TypeError on BytesIO image in table HOT 2
- progress bar or output the page being processed
- Euro sign '€' raises a KeyError HOT 1
- How to add encoding? HOT 1
- Incomplete section
- No borders when combining cells in table
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdfme.