Xerox Holdings Corp. has set its sights on a takeover of personal-computer and printer maker HP Inc., an audacious move that would unite two fading stars of technology.

Xerox is considering making a cash-and-stock offer for HP, which has a market value of about $27 billion, according to people familiar with the matter. The copier maker’s board discussed the possibility Tuesday, the people said.

There...