Shift text elements in a PDF form XObject


When looking at my elements using a reader the first level elements are


e_form //Contains logo, address, and letter content


e_text_begin //barcode

e_text_new_line //barcode

e_text //barcode

e_text_end //barcode

e_text_begin //document number

e_text_new_line //document number

e_text//document number

e_text_end//document number

I need to shift the text only elements in the e_form down by 1 inch.

I know I can shift the whole form, but that moves the letter head logo.

I know I can shift the whole page, but that moves the letter head logo, the document number and the barcode.

So how can I go specifically into a form and translate those text elements? In the ultimate case I only want to translate the elements that are the address text (Fall in a bounding box in relation to the page).

I have searched the forums, the site, and the web and none of the examples address this particular need. The reason we need this is the letter is generated from a different program that cannot be changed, and it produces a pdf. When we fold the printed letter, the address is not visible in the envelope. So we are trying to modify this pdf before it prints to shift the address down 1 inch so it matches the envelope clear window after the fold.


You can access elements of the Form by calling FormBegin() on it. Then you can shift every text element in the Form skipping the logo.

As a starting point please take a look at is ElementEdit The sample is changing text color to blue but you can also shit the text by modifying text matrix. Now it is not as simple because text is also positioned with CTM (current transformation matrix) which is applied after the text matrix.