I need to install bathtub on the floor where ther is no space for P-trap.

How far from a tub drain can the trap be located?

That is, can I run a horizontal drain for 3 feet (at about 1 inch drop) and install a P-trap and a vent 3 feet away from the tub drain?

Or is it asking for trouble?