Preheat your oven to 375 degree Fahrenheit
Heat butter in a frying skillet over medium-low heat.
Sauté the onions for 4-6 minutes or until tender and slightly brown. Meanwhile, strain and discard water from the spinach and put in a bowl.
Add the onion, gruyere and parmesan cheese, eggs, scallions, bread crumbs, pepper, salt, and nutmeg in the spinach and mix to blend well.
Unfold one sheet of the puff pastry and lay it well on a baking sheet lined with parchment paper.
Spread the spinach mixture on the pastry leaving a border of one inch on the sides. Brush the border without the spinach mixture with the egg wash.
Take the second sheet of the puff pastry, and roll it out until its larger by an inch on all sides. (be sure to flour the rolling surface to avoid sticking)
Now take the second sheet and cover the spinach mixture and crimp the edges with a fork to seal.
Brush the top pastry with the egg wash making sure not to drip the side as this may hinder the puff from rising.
Make about three slits in the pastry and sprinkle with pepper and salt. Bake for 35-40 minutes or until the spanakopita puff pastry is lightly browned.
Remove from the oven onto a cutting board and serve hot as an appetizer or with fresh salad for a delightful meal.