Watermark

Revision as of 22:50, 26 October 2025 by Jean Abou Samra (talk | contribs) (Import snippet from LSR)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Add a watermark directly into a LilyPond file, without using a third part PDF tool.

\version "2.24.0"

watermark = \markup
\with-dimensions-from\null {
  \translate #'(-70 . -120)
  \rotate #50
  \fontsize #13
  \pattern #12 #Y #3 
  \pattern #3 #X #5
  \bold\with-color #(rgb-color .9  .9  .9) "copyrighted material"
}
\paper { 
  print-first-page-number = ##t
  %page-count = 2
  ragged-last-bottom = ##f 
  oddHeaderMarkup = \markup { 
    \combine\watermark
    \fill-line {
      \null
        \if \should-print-page-number 
        \fromproperty #'page:page-number-string
      }
  }
  evenHeaderMarkup = \markup { 
    \combine\watermark
    \fill-line {
        \if \should-print-page-number 
        \fromproperty #'page:page-number-string
        \null
      }
  }
}
\header { 
  dedication = \markup \italic "This music is dedicated to the LSR" 
  title = "This is a Title" 
  subtitle = "This is a Subtitle"
  subsubtitle = "This is a Subsubtitle"
  piece = "This is a Piece"
  opus = "Op. 000"
  instrument = "This is an Instrument"
  composer = "This is a Composer"
  arranger = "This is an Arranger"
  poet = "This is a Poet"
  copyright = "Copyrighted material"

}
{ \repeat unfold 60 { c' d' e' f' } \bar "|." }