Atiyah-Patodi-Singer came up with a signature formula for manifolds with boundary by introducing a correction term called eta invariant, extending Atiyah-Singer signature formula for closed manifolds. We deal with flat Hermitian bundles over surfaces with boundary to relate the signature to Toledo invariant by introducing rho invariant, which is a refined version of eta invariant and a class function over U(p,q). This is a joint work with X. Wan and P. Pansu.