Integrated PDF signatures are explained quite graphically and in more detail in the Adobe document Digital Signatures in a PDF. They furthermore are specified in the PDF specification ISO 32000-1:2008 made available here by Adobe in section 12.8 Digital Signatures.
Depending on your programming context, there are many PDF libraries supporting the creation of integrated PDF signatures and also many products using these libraries. Some of them are even available for free subject e.g. to the AGPL.
(This article is essentially a copy of this answer on the information security site, this answer on stackoverflow, and some words from the PDF specification.)