// PD test program

// Write a little PD file for testing

//BLDR pdtest pdtest1 pdtest2 pdml

external
	[
	PDInit
	PDNewPage
	PDFinish
	PDRectangle
	PDTrapezoid
	PDSetPos
	PDSetColor
	PDPriority
	PDSetColorP
	PDString

	MulDiv
	]

static resolution=384
static portrait=true

let Main() be
[
	PDInit("TestColor.pd", resolution, portrait, 2, true, false)

	PDSetPos(Inches(30), Inches(30))
	PDString("This is a string of text.")
	PDRectangle(Inches(30), Inches(5), Inches(20), Points(25))

//Magenta
	PDSetPos(Inches(30), Inches(25))
	PDString("Magenta")
	PDRectangle(Inches(35), Inches(5), Inches(20), Points(25))

	PDNewPage(3, false, false)

	PDSetPos(Inches(30), Inches(30))
	PDString("This is a string of text.")
	PDRectangle(Inches(30), Inches(5), Inches(20), Points(25))

//Yellow
	PDSetPos(Inches(40), Inches(25))
	PDString("Yellow")
	PDRectangle(Inches(40), Inches(5), Inches(20), Points(25))

	PDNewPage(1, false, true)

	PDSetPos(Inches(30), Inches(30))
	PDString("This is a string of text.")
	PDRectangle(Inches(30), Inches(5), Inches(20), Points(25))

//Cyan
	PDSetPos(Inches(50), Inches(25))
	PDString("Cyan")
	PDRectangle(Inches(45), Inches(5), Inches(20), Points(25))

	PDFinish()

]

// Actually 10'ths of inches

and Inches(i) = MulDiv(i, resolution, 10)

and Points(i) = MulDiv(i, resolution, 72)