Fix position of form fields containing page numbers
Dear community,
I have an Excel VBA macro which adds page numbers to certain pdf documents.
Here an example of how this generally looks like:
| Set AcroApp = CreateObject("AcroExch.App") | |
| Set KurzGesamt = CreateObject("AcroExch.PDDoc") | |
| KurzGesamt.Open (strPfadVerteilungEndlauf & strNameKurzGesamt) | |
| Set jso = KurzGesamt.GetJSObject | |
| intSeiten = KurzGesamt.GetNumPages | |
| For i = 2 To intSeiten | |
| Set objTextfeld = jso.AddField("Textfeld" & i, "text", i - 1, Array(810, 15, 830, 25)) | |
| objTextfeld.Value = Str(i) | |
| objTextfeld.textSize = 10 | |
| objTextfeld.textFont = "Calibri" | |
| Next i | |
| jso.FlattenPages | |
| Call KurzGesamt.Save(1, strPfadVerteilungEndlauf & strNameKurzGesamt) | |
KurzGesamt.Close |
This code has worked perfectly for the last months but now, suddenly, I have the following problem:
Before, all form fields (containing the page numbers) were at the bottom on the right side of each page. (I got the "Array" values from above by trial and error.)
Now, the position is only correct on empty pages of the documents, while on the others, the page numbers are smaller and rather at the center of the page than on the right side.
It seems like font and position are adjusting to the respective page.
However, in the original pdfs nothing has changed and before, using the same code, this was not the case.
Therefore, my questions are:
1. Is there any setting in the Acrobat 7.0 I have to change in order to place the form fields independently from the remaining text and
2. if so, how can I define this as standard setting or change it via VBA?
3. If the problem has nothing to do with Acrobat settings, how must I change my VBA code to get the correct form field position and font size?
By the way, I've already tried to uninstall and reinstall Acrobat 7.0, because I thought, I'd maybe changed any setting accidentially, but this did not solve the problem.
Thank you in advance for any help!
