I understand that the OCR text recognition is rendered as a layer; so are the form fields. Is there any way to separate these layers so that they can be used independently?
The term "Layers" is a bit over used, but it does have a special meaning in PDFs. It refers to Optional content group layers.
The text created with OCR is not placed on an OCG layer. Nor is it on any other kind of layer. It's placed at the end of the page content so that it is drawn over top of the image. This is for selection purposes, the text itself is invisible.
Form fields are on a layer of sorts. It's more accurate to think of the page content as fixed, and form fields as floating over the content. And form fields by nature are handled independently from content.
The text created with OCR is not placed on an OCG layer. Nor is it on any other kind of layer. It's placed at the end of the page content so that it is drawn over top of the image. This is for selection purposes, the text itself is invisible.
Form fields are on a layer of sorts. It's more accurate to think of the page content as fixed, and form fields as floating over the content. And form fields by nature are handled independently from content.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script