Skip to content

Commit

Permalink
feat(report): added Checkmarx logo to pdf report (#4838)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaela-soares authored Feb 15, 2022
1 parent 7429db3 commit eccc929
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Binary file added docs/img/logo/checkmarx-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions pkg/report/pdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package report
import (
_ "embed" // used for embedding report static files
"fmt"
"os"
"path/filepath"
"time"

Expand Down Expand Up @@ -239,6 +240,19 @@ func createResultsTable(m pdf.Maroto, query *model.QueryResult) {
}

func createHeaderArea(m pdf.Maroto) {
m.Row(rowLarge, func() {
m.Col(colSix, func() {
cxLogoPath := filepath.Join("docs", "img", "logo", "checkmarx-logo.png")
_, err := os.Stat(cxLogoPath)
if err != nil {
cxLogoPath = filepath.Join("..", "..", "docs", "img", "logo", "checkmarx-logo.png")
}
_ = m.FileImage(cxLogoPath, props.Rect{})
})
})
m.Row(colFive, func() {
m.ColSpace(0)
})
m.SetBackgroundColor(getPurpleColor())
m.Row(rowXLarge, func() {
m.Col(colSix, func() {
Expand Down

0 comments on commit eccc929

Please sign in to comment.