In this article we will create a PDF form from scratch entirely in code. The form has three text fields: A, B and SUM and a single button: ADD. When the user opens the created PDF in a PDF reader and fills fields A and B and hits the ADD button, JavaScript will be invoked that fills field SUM with the sum of A and B.