Improve pdf
This commit is contained in:
parent
bf0548ecfe
commit
976936d480
4 changed files with 90 additions and 22 deletions
|
|
@ -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(...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue