Electrically conducting polyaniline is found to be suitable for several lithographic applications. Because the polyaniline is not significantly soluble in the conducting state, the material has generally been processed by first applying the soluble, nonconducting version of the material, and in a second step externally doping the polymer film with aqueous acids. We have eliminated the need for this type of external doping by developing methods of inducing the doping in a dry fashion in situ in the polymer. This is accomplished by incorporating onium salts or amine triflate salts in the polyaniline which decompose upon radiation or thermal treatment, respectively, to generate the active dopant species, i.e., protonic acids. The use of these in situ dopants simplifies the processing of the conducting polyaniline and makes the material more convenient for lithographic applications. With the use of onium salts, the polyaniline is made into a high resolution negative conducting resist. 0.25-mu-m conducting lines have been patterned with e-beam radiation. Polyaniline is found to be an effective discharge layer for e-beam lithography and a removable discharge layer for the high resolution inspection and dimensional measurements of x-ray and optical masks by scanning electron microscopy (SEM). In addition, the polyaniline can be used for both electrolytic and electroless-type metallization processes.