Catalysis of the reaction: 1,7-dimethylxanthine + S-adenosyl-L-methionine = H+ + caffeine + S-adenosyl-L-homocysteine. Also converts theobromine to caffeine and 7-methylxanthine to theobromine.
paraxanthine:S-adenosyl-L-methionine 3-N-methyltransferase activity