Finding co-ords

Finding co-ords

Forum member · Oct 23, 2006
Hi there I'm sure this is a newbie question but I'm trying to fill data values into a PDF form using something like the FormFill.cs example. It is all working fine (product seems great!) but I can find out how to calculate the correct x/y/height/width co-ords to supply in the Label page element constructor. I tried to take a screen grab of the PDF template and use pixel values but this seems to be the wrong system. I've been using trial and error to get the correct co-ords but they don't seem to have any straightforward relationship to pixel positions. I'm sure this must be simple but I couldn't find a solution in the help docs. Pls point me in the right direction. Many thanks!

Re: Finding co-ords

Support · Oct 23, 2006
Hello, You can get the X, Y, Height, and Width values of a form field by using the GetX() and GetY() methods and the Height and Width properties of the PdfFormField class. With these values you can get the coordinates to place the labels or you can use the CreateLabel method of the PdfFormField class to place a label on the form field with out knowing the X, Y coordinates of the form field. You can refer to the Form Flattening topic in the help documentation on our web site that shows use of the CreateLabel method. Thanks, ceTe Software Support Team

Re: Finding co-ords

Forum member · Oct 24, 2006
Thanks for this, but I think mine is a different case. There are not any embedded form field objects inside the PDF as far as I know. The client has just created a pretty form in a graphics programme and used a PDF printer to output. The field values therefore have to be overlayed onto the given PDF ensuring that they sit over the form field areas. So my example is more like FormFill.cs rather than AcroFormFill.cs. Hope this makes sense!

Re: Finding co-ords

Support · Oct 24, 2006
Hello, You can use the LayoutGrid page element to find out the exact location where you want to place the labels on a page. [VB.NET] ' Create a layout grid Dim grid As LayoutGrid = New LayoutGrid(LayoutGrid.GridType.Decimal) ' Add the layout grid to the page MyPage.Elements.Add(grid) [C#] // Create a layout grid LayoutGrid grid = new LayoutGrid( LayoutGrid.GridType.Decimal ); // Add the layoutgrid to the page page.Elements.Add( grid ); Our product uses coordinating system of points where one inch is equal to 72 points. You can refer to the Coordinate System topic in our Help Documentation for more details. Thanks, ceTe Software Support Team