John Francis Lanham, 66, a retired government printing official who was active in Masonic organizations, died Sunday at his home in Hillcrest Heights after a heart attack.

He was a native of Washington and a graduate of Eastern High School. He joined the Government Printing Office in 1936, then transferred to the Census Bureau, where he was director of census printing when he retired in the mid-1970s.

Mr. Lanham had been secretary of the Scottish Rite bodies in Washington since retiring from the government. He also was a master of the Benjamin B. French Masonic Lodge and had been lodge secretary for the past 14 years.

He was a 33rd-degree Scottish Rite Mason and belonged to the Almas Temple, the Royal Order of Scotland, and Capitol Court No. 50, Order of Jesters.

Mr. Lanham was a member of Olivet Episcopal Church in Alexandria.

Survivors include his wife, the former Margaret Saylor, of Hillcrest Heights; two daughters, Jean Beaudry of Reston, and Gail Foxworthy of Herndon; a sister, Catherine Small of Forrestville, and four grandchildren. h

The family suggests that expressions of sympathy be in the form of contributions to the Scottish Rite Foundation for the District of Columbia, 2800 16th St. NW, Washington, 20009.