Not long ago, HP (NYSE:HPQ) was on the wrong end of most every industry pundit's expectations. The negativity centered on the "dying" PC market and HP's floundering printing unit. HP continued to report fairly strong PC sales, but it was just a matter of time before the rug was pulled out from under it -- or so the bears thought.

As we wind up 2017, it's apparent that HP is firmly established as the dominant player in the PC market. To the astonishment of some, HP's printing unit isn't just holding its own; it's also become a growth engine. CEO Dion Weisler deserves much of the kudos for implementing a new development and sales strategy.

For investors in search of growth and income, the better news is that HP remains a bargain despite its stellar performance in 2017.

A woman in silhouette, standing with her arms raised overlooking the ocean, positioned as the 1 in 2017.

Image source: Getty Images.

The foundation is complete

Up 45%, HP's stock has performed admirably this year to say the least. Not only is HP stock's performance warranted, but there's also still plenty of upside. At a mere  15.4 times trailing earnings, HP is valued well below its peers. For perspective, it's trading at just 11.8 times expected earnings, about half today's average of 23.3 times trailing earnings.

Remarkably, despite its outstanding quarter to end the fiscal year, HP shares sank 6%. However, HP's total revenue of $13.93 billion  was good for an 11% year-over-year increase, led by a 16% jump in PC sales. HP also performed on the bottom line, reporting per-share earnings of $0.39, 30% above last year's $0.30 per share.

HP's printing unit also finished 2017 on a high note, climbing 7% to $4.88 billion. The best-performing segment within the division was supply sales, which rose 10% to $3.13 billion. A year  ago, printing revenue was down 8% to $4.56 billion, largely because of a painful 12% decline in supply sales.

But implementing an automated supply ordering feature, among other strategic moves, has since reinvigorated the entire printing unit. With the $1.05 billion deal for Samsung's (NASDAQOTH: SSNLF) printing division said and done, HP's should see continued growth.

Two HP OMEN laptops opened and positioned back-to-back.

Image source: HP.

The best is yet to come

Not only are PCs alive and well -- at least for HP, after becoming the world leader again this year -- but research firm Gartner also expects a slight  increase in sales in 2018. Sure, the 0.08% isn't much, but it would be the first PC sales increase in nearly seven years. HP is more than holding its own in 2017, with third-quarter shipments rising  4.4%.

HP's continued PC growth is really impressive, considering it was the only manufacturer to chalk up a rise in sales. China-based Lenovo (OTC:LNVGY), the one-time global PC leader, registered a 1.5% drop in shipments last quarter, and Dell, which is a distant third to HP and Lenovo, was down 0.4%.

Weisler's decision to concentrate on targeting niche markets is working wonders. Devices like HP's virtual reality-ready OMEN series is designed for the world's gamers, and Weisler's business shift is working in printing as well.

Strong and getting stronger

Another example of HP's sales and development plans is its Sprocket device, a pocket-sized photo printer. Priced at $130, the sprocket isn't going to boost printing sales dramatically, but it serves as a clear indication of HP's new-ish direction -- not to mention the $10 in paper supplies when a user needs a refill.

The aforementioned deal with Samsung is very  much in line with HP's targeting of specific markets. In addition to over 6,500 printing patents and nearly 1,300 technicians, a key component of the acquisition is HP's new A3 business printer.

The $55 billion A3 market is "the largest growth opportunity in business printing." The A3 targets professionals in search of a high-end copier with multi-function print capabilities. Fewer components translate to fewer paper jams and service calls.

When it's all said and done

It's only been two years since HP split with Hewlett-Packard Enterprises, which makes its strong results even more impressive. Considering its discounted share price, 2.5% dividend yield, and growth across every segment, 2017 was certainly a year to remember for HP.