You've got a book to make! You work at a virtual, old-fashioned printing press. To help you arrange your monospace letters faster, you decide to make the shortest program possible to help you. Given a string of text and a page size, generate and output each page of the text.

Examples

For example, with a page width of 14, height 7, and some text, here is your book:

14, 7, "Fruits make an extremely good snack due to their utterly scrumptious sweetness. They are also very healthy for you."
+------------+
| Fruits     |
| make an    |
| extremely  |
| good snack |
| due to     |
+------------+

+------------+
| their      |
| utterly    |
| scrumptio- |
| -us        |
| sweetness. |
+------------+

+------------+
| They are   |
| also very  |
| healthy    |
| for you.   |
|            |
+------------+


Here's the basic page setup:

|---i.e.14---|
+------------+ - 
| Xxxxxxxxxx | |
| Xxxxxxxxxx | i.  
| Xxxxxxxxxx | e. 
| Xxxxxxxxxx | 7
| Xxxxxxxxxx | | 
+------------+ - 


A few things


There is a one-space margin between the page edges and the text.
The width and height include the box edges, if that wasn't clear.
Wraparound only occurs if a word can't fit on a single line. 
The program needs to be able to output as many pages as needed, and only that many.
Your program has to support any page size, not just 14 by 7.
This is code golf, so the smallest solution in bytes (any language) wins.
Don't ruin the fun. Standard loopholes are obviously not allowed. 


Oh, and, by the way:

+------------+
| May the    |
| best book  |
| publisher  | 
| win. Good  |
| Luck!      |
+------------+

+------------+
| Best       |
| program    |
| so far:    | 
| Charcoal   |
|            |
+------------+
Python 2, 306 304 283 279 bytes



def f(w,h,s):
 b=[];w-=4;h-=2;H='+-'+'-'*w+'-+';x=l='';s=s.split()
 while s:
&#9;W=s.pop(0)
&#9;if W[w:]:W,s=W[:w-1]+'-',['-'+W[w-1:]]+s
&#9;if len(l+W)&lt;=w-(l&gt;x):l+=' '*(l&gt;x)+W
&#9;else:b+=[l];l=W
 b+=[l]+[x]*h
 while any(b):print'\n'.join([H]+['| %-*s |'%(w,b.pop(0))for _ in' '*h]+[H,x,x])


Try it online!