![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
github.com/andreyhoffmann1103/maroto
A Maroto way to create PDFs. Maroto is inspired in Bootstrap and uses Gofpdf. Fast and simple.
Maroto definition: Brazilian expression, means an astute/clever/intelligent person.
You can write your PDFs like you are creating a site using Bootstrap. A Row may have many Cols, and a Col may have many components. Besides that, pages will be added when content may extrapolate the useful area. You can define a header which will be added always when a new page appear, in this case, a header may have many rows, lines or tablelist.
go get
:go get -u github.com/johnfercher/maroto
dep
:dep ensure -add github.com/johnfercher/maroto
In the PDFs folder there are the PDFs generated using Maroto, and in the examples folder there are subfolders with the code to generate the PDFs.
func main() {
m := maroto.NewMaroto(maroto.Portrait, maroto.A4)
//m.SetDebugMode(true)
byteSlices, _ := ioutil.ReadFile("examples/internal/assets/images/biplane.jpg")
base64 := base64.StdEncoding.EncodeToString(byteSlices)
headerSmall, smallContent := getSmallContent()
headerMedium, mediumContent := getMediumContent()
m.RegisterHeader(func() {
m.Row(20, func() {
m.Col(func() {
m.Base64Image(base64, maroto.Jpg, maroto.RectProp{
Percent: 70,
})
})
m.ColSpaces(2)
m.Col(func() {
m.QrCode("https://github.com/johnfercher/maroto", maroto.RectProp{
Percent: 75,
})
})
m.Col(func() {
id := "https://github.com/johnfercher/maroto"
_ = m.Barcode(id, maroto.BarcodeProp{
Proportion: maroto.Proportion{50, 10},
Percent: 75,
})
m.Text(id, maroto.TextProp{
Size: 7,
Align: maroto.Center,
Top: 16,
})
})
})
m.Line(1.0)
m.Row(12, func() {
m.Col(func() {
m.FileImage("examples/internal/assets/images/gopherbw.png")
})
m.ColSpace()
m.Col(func() {
m.Text("Packages Report: Daily", maroto.TextProp{
Top: 4,
})
m.Text("Type: Small, Medium", maroto.TextProp{
Top: 10,
})
})
m.ColSpace()
m.Col(func() {
m.Text("20/07/1994", maroto.TextProp{
Size: 10,
Style: maroto.BoldItalic,
Top: 7.5,
Family: maroto.Helvetica,
})
})
})
m.Line(1.0)
m.Row(22, func() {
m.Col(func() {
m.Text(fmt.Sprintf("Small: %d, Medium %d", len(smallContent), len(mediumContent)), maroto.TextProp{
Size: 15,
Style: maroto.Bold,
Align: maroto.Center,
Top: 9,
})
m.Text("Brasil / São Paulo", maroto.TextProp{
Size: 12,
Align: maroto.Center,
Top: 17,
})
})
})
m.Line(1.0)
})
m.TableList(headerSmall, smallContent)
m.TableList(headerMedium, mediumContent, maroto.TableListProp{
Align: maroto.Center,
HeaderProp: maroto.FontProp{
Family: maroto.Courier,
Style: maroto.BoldItalic,
},
ContentProp: maroto.FontProp{
Family: maroto.Courier,
Style: maroto.Italic,
},
})
m.Row(40, func() {
m.Col(func() {
m.Signature("Signature 1", maroto.FontProp{
Family: maroto.Courier,
Style: maroto.BoldItalic,
Size: 9,
})
})
m.Col(func() {
m.Signature("Signature 2")
})
m.Col(func() {
m.Signature("Signature 3")
})
})
_ = m.OutputFileAndClose("examples/internal/pdfs/sample1.pdf")
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.