Dark matter particle annihilation or decay can produce monochromatic gamma-ray lines and contribute to the diffuse gamma-ray background. Flux upper limits are presented for gamma-ray spectral lines from 7 to 200 GeV and for the diffuse gamma-ray background from 4.8 GeV to 264 GeV obtained from two years of Fermi Large Area Telescope data integrated over most of the sky. We give cross-section upper limits and decay lifetime lower limits for dark matter models that produce gamma-ray lines or contribute to the diffuse spectrum, including models proposed as explanations of the PAMELA and Fermi cosmic-ray data.