Trying to do this optically is really hard for me.
When shooting paintings, it's all about setup.
Lets assume the painting is on a perfectly vertical wall and the painting is flat against the wall (not leaning outward at the top of the painting). The floor also needs to be at a right angle to the wall.
Find the center of the painting and measure that point to the floor.
Set up your camera and tripod to an appropriate distance. You want to be as far from the painting as possible to minimize perspective distortion, say 10 feet. Larger paintings, like the Nightwatch, you'll need to get back further. Your optical axis needs to be at a right angle from the wall. Flooring tile seams can help you determine this.
Level your camera using a bubble level. They make small levels for mounting on camera hot shoes, or, you can get a bulls eye level from a hardware store. The flash hot shoe is generally a good reference surface, but you need to verify this by comparing the bottom of the camera to the hot shoe. If shooting towards the floor (ala copy stand technique), I find the LCD screen is a good reference surface.
Adjust your camera height so the optical axis lines up with the center of the painting. Recheck the leveling of your camera using the bulls eye level as many tripods will shift slightly. Since it's unlikely you'll have a tape measure, you can bring the camera close to the painting and make the height adjustment.
For architecture, you need to keep the optical axis horizontal (use the bulls eye level). This will minimize converging lines. You also need to horizontally center your camera with the structure. For tall buildings, you can look in to tilt-shift lenses.