Book Spine Calculator

From Scribus Wiki
Revision as of 05:46, 1 October 2010 by Owencook (talk | contribs) (Book Spine Calculator)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

#/usr/bin/env python

import scribus
import math  


from scribus import UNIT_POINTS,BUTTON_OK,ICON_WARNING

startMsg = "The conventional design suggests that spine width is calculated as follows \n\n10 divided by 176, multiplied by the number of pages of text within the book, divided by 90, multiplied by the weight of the paper in gsm, add 1mm for the crease in the cover and this will give you a soft cover book thickness in millimetres.\n\n Add 3mm to this figure and you have the spine thickness of a hard covered book"

start = scribus.messageBox('Book Spine Width Calculator', startMsg, ICON_WARNING, BUTTON_OK)


P = scribus.valueDialog('Spine Calculator','Enter Number of pages')
P = float(P)
G = scribus.valueDialog('Spine Calculator','Enter Paper Weight (gsm)')
G = float(G)

A = float(10)
B = float(176)

bsw = (A/B) * (P/90) * G + 1 + 3
bsw = float("%2.2f" % (bsw))
bsws = bsw - 3
P = int(P)
G = int(G)

widthMsg = "The spine thickness for a soft cover book of " + str(P) + " pages of " + str(G) + " gsm paper is " + str(bsws) + " mm.\n\nThe spine thickness for a hard cover book of " + str(P) + " pages of " + str(G) + " gsm paper is " + str(bsw) + " mm."

end = scribus.messageBox('Book Spine Width', widthMsg, ICON_WARNING, BUTTON_OK)