Improve pdf
Some checks failed
/ Run tests (push) Successful in 2m4s
/ Run system tests (push) Failing after 2m30s
/ Build, push and deploy image (push) Successful in 1m34s

This commit is contained in:
david 2024-11-24 03:16:36 +01:00
parent bf0548ecfe
commit 976936d480
4 changed files with 90 additions and 22 deletions

View file

@ -45,8 +45,8 @@ module PdfDocuments
@prawn_document.markup "<h4>#{text}</h4>"
end
def text(text)
@prawn_document.text text, markup_options[:text]
def text(text, **args)
@prawn_document.text text, markup_options[:text].merge(args)
end
def rich_text(text)
@ -69,8 +69,8 @@ module PdfDocuments
}
end
def logo
@prawn_document.image "app/assets/images/logo-apfelschule.png", width: 150
def logo(width: 24, xs: true)
@prawn_document.image "app/assets/images/logo-apfelschule#{ xs ? "_xs" : "" }.png", width:
end
def prepare_rich_text(rich_text)
@ -81,6 +81,7 @@ module PdfDocuments
rich_text.sub(/(<br>)+$/, "")
end
# @prawn_document.draw_text("Dokument erstellt am #{Time.current.strftime('%d %B %Y')} um #{Time.current.strftime('%H:%M:%S')}", at: [ 0, -15 ])
def font(...)
@prawn_document.font(...)