 Hartman was born at Cottage, Pennsylvania.He attended public and private schools and the Hollidaysburg Seminary in Hollidaysburg, Pennsylvania.He was employed as a clerk in a general store in Hollidaysburg from 1872 to 1878, and as a manager of a blast furnace at McKees Gap, Pennsylvania, from 1878 to 1891.