refs #19104 @5m Copied changes from the backend fpdf library

/cc @omares @dfreudenberger