still getting error. actually i am using asp.net on the click event of a button the pdf will be generated so in code i make a function which will generate a pdf. errors after placing the code in "" are: only assignment,call,increment,decrement and new object expressions can be used as a statement the name background does not exist in current context. and many more.