The Harry Potter publisher expects a jump in profits after books provided a “ray of sunshine during dark year”.