If you follow these directions to install a new door to an existing door frame it should fit perfectly even if the frame is out of square. You should read and understand this entire article before attempting. I have ran into many situations where a table saw was not going to do the job because it only cuts square and a belt sander can be slightly wavy.Here are the tools you need: A good circular saw with a good blade ( your cut is only as good as your saw ), A straightedge at least an inch longer than the door you are going to cut, and two good quality nonmaring clamps.
Figure out the hight the door needs to be. I leave an 1/8 inch at the top for the gap and a 1/2 inch at the bottom. Make your marks. Measure 1 1/2 inches from your marks toward the finish door ( away from the piece that is going to get cut off and make new marks ( I make them a little darker or longer so I can tell them apart ). Clamp your straightedge down firmly on the finish side of the second set of marks. Now all you have to do is run your saw with the small side of the fence of the saw against the straightedge. This is important. Most circular saws are 1 1/2 inches from the outside of the small side of the fence to the other side of the blade, but make sure you check your saw.
Whatever the measurement is on your saw use that for the second set of marks (my saws happen to be exact 1 1/2 and so are most of them). Once you have cut the hight it is time to measure and cut the width. Measure the width of the opening top and bottom. transfer marks on the door minus 1/4 inch (allows for the 1/8 inch gap on each side ). Measure from the striker side and mark on the hinge side. Mark the 1 1/2 away from the cut piece (make sure you use the measurement of your saw ). Clamp the straightedge on the finsh side of the line. Run the saw down the straightedge with the small edge of the fence against the straightedge and the door should be perfect to the opening. If you need to take off a hair, move the straightedge back a hair from the marks clamp it down and run it again. You can even take off a 1/32 using this method. It even works great for cutting plywood.