<PAGE>   1
                                                                   Exhibit 10.40


                   AMENDMENT NO. 2 TO STOCK PURCHASE AGREEMENT



         This Amendment No. 2 to the Stock Purchase Agreement ("Amendment No.
2") is made and entered into as of October 1, 1996, by and between Software
Publishing Corporation (the "Buyer") and Digital Paper, Inc., a California
corporation, and Daniel J. Fraisl, Carl Meyer and Anthony N. Hoeber
(collectively referred to as the "Shareholders"), with reference to the
following facts:

         A. WHEREAS, the parties have previously entered into that certain Stock
Purchase Agreement, dated as of March 31, 1995, as amended (the "Stock Purchase
Agreement"), pursuant to which Buyer acquired all of the outstanding capital
stock of Digital Paper, Inc. from the Shareholders.

         B. WHEREAS, pursuant to Section 2.2(b)(2) of the Stock Purchase
Agreement, the Shareholders were to receive a certain payment, partially in cash
and, at the option of the Buyer, partially in shares of Buyer Common Stock.

         C. WHEREAS, the parties now desire to amend the Stock Purchase
Agreement to, among other things, allow the payment to be made pursuant to
Section 2.2(b)(2) of the Stock Purchase Agreement to be made in cash or in
Allegro Common Stock, at the option of each Shareholder individually.

         NOW, THEREFORE, in consideration of the foregoing and the mutual
covenants and conditions hereinafter contained, and for good and valuable
consideration, the receipt and sufficiency of which are hereby acknowledged,
Buyer, Digital Paper, Inc., Allegro New Media, Inc., a Delaware corporation
("Allegro") and the Shareholders agree to amend the Stock Purchase Agreement as
follows:

         1. Section 2.2(b)(2) is hereby modified to provide that the $1,650,000
payment called for therein shall be made in cash or in shares of Common Stock of
Allegro at the option of each Shareholder with respect to the consideration to
be paid to him.

         2. The Shareholders acknowledge that the transactions contemplated by
the Agreement and Plan of Reorganization dated as of October 1, 1996 among
Buyer, Allegro, and SPC Acquisition Corp. (the "Reorganization Agreement") does
not give rise to an "Acceleration Event" under the Stock Purchase Agreement.
This clause is only relevant as it pertains to the Reorganization Agreement.

         3. This Amendment is effective as of the effective date (the "Effective
Date") of the merger contemplated by the Reorganization Agreement and shall have
no binding effect should the transactions contemplated pursuant to the
Reorganization Agreement not be consummated.
<PAGE>   2
         4. Except as expressly provided herein, all other provisions, terms and
conditions of the Stock Purchase Agreement shall remain in full force and effect
and all defined terms used herein and not otherwise defined herein shall have
the meanings ascribed to them in the Stock Purchase Agreement.

         IN WITNESS WHEREOF, the parties hereto have duly executed this
Amendment No. 2 effective as of the date first written above.

THE SHAREHOLDERS:                           BUYER:

                                            SOFTWARE PUBLISHING CORPORATION
/s/ Daniel J. Fraisl
--------------------------------
Daniel J. Fraisl
                                            By: /s/ Miriam K. Frazer
                                                -------------------------------
                                            Name:   Miriam K. Frazer
/s/ Carl Meyer                              Title:  Vice President - Finance
--------------------------------
Carl Meyer

                                            DIGITAL PAPER, INC.
/s/ Anthony N. Hoeber
--------------------------------
Anthony N. Hoeber                           By: /s/ Daniel J. Fraisl
                                                -------------------------------
                                            Name:   Daniel J. Fraisl
                                            Title:  President
Accepted and Agreed as of
the date first above written:
ALLEGRO NEW MEDIA, INC.


By: /s/ Barry A. Cinnamon
--------------------------------
Name:   Barry A. Cinnamon
Title:  President