Set a miter saw to a straight cut. This means the saw blade cuts across the baseboard's width to give it a straight edge.
Set a piece of baseboard molding on the miter saw table. Position the saw blade over one of the baseboard's ends. If the baseboard will be on the door's left side, position the saw blade over the left end. If the baseboard will be on the door's right side, position the saw blade over the right end. Cut approximately 1 inch off this end to make it a perfect straight cut.
Measure the distance from the door trim to the nearest corner. Transfer this measurement to the piece of baseboard you just cut, measuring from the cut end down.
Switch the miter saw blade to a 45-degree angle, so the baseboard can join with another baseboard at the corner and form a 90-degree turn. Position the baseboard under the saw blade and cut the board to length.
Set the baseboard against the wall, over the area where the floor meets the wall. Butt the straight end tight against the door trim. Drive 6d finishing nails through the baseboard and into the bottom plate (the board that the wall studs sit on) with a pneumatic nail gun.