An appellate court ruling gives a boost to New Jersey’s farmland preservation program by allowing the state to buy land from a farmer for a “substantially similar” price as that offered by a developer. The 3-0 ruling by a state Appellate Division panel said the state’s offer does not need to be identical to prevail. The decision comes as New Jersey, the nation’s most densely populated state, strives to maintain an agricultural industry eroded by burgeoning development. Farmers can typically reap a windfall by selling their land to home builders. State Attorney General Stuart Rabner said the ruling was a “significant victory” for New Jersey regarding farmers who sign on to preservation programs. The decision was “an affirmation of our legal position that the state has the right of first refusal to purchase and preserve critical farmlands in our state,” Rabner said in a statement issued Monday.