Connecting the linear regulator directly to AC line
I need to withstand 400 VAC = 625 VDC


A common method is to use a voltage dropping capacitor feeding a zener diode. If you have an AC input then you will be using some form of rectifier and the zener can be placed after the rectifier. For a 1 mA load, it's probably advisable to feed 2 mA into the zener and from this you can calculate the value of the capacitor that drops the voltage. This is the general idea: -



So, you get regulation (as good as a zener can provide) and very little heat produced. I estimate that C1 could have a reactance as high as 200 kohms and at 50 Hz, this means about 15 nF. R1 won't need to be a 5 watt type because your current consumption is so low (&lt; 1mA).

PLEASE BE AWARE THAT ANY METHOD OF DERIVING A DC POWER SUPPLY FROM THE AC MAINS WITHOUT USING AN ISOLATION TRANSFORMER IS DANGEROUS.