Default location of PageElements

Default location of PageElements

Forum member · Mar 15, 2007
Hello everybody, I just started working with DynamicPDF. What I find very strange is the fact that any ImportedPageData object (and maybe PageElements in general?) that I add to a Page is by default located in the middle of the page instead of its top left corner. Further, to correct the layout, what coordinates do I need to use for the XOffset and YOffset properties? I know that DynamicPDF is using Points as atomic entity. What translation do I need to do? Thanks a lot in advance, Martin

Re: Default location of PageElements

Support · Mar 15, 2007
Hello Martin, All the page elements will be added to the PDF document according to the X, Y coordinates given to them. It will display the elements in the top left corner if you have given the X, Y as 0,0. The page will only have default margins set within it. XOffset and YOffset are same as the X, Y coordinate but we use these in case of the ImportedPageData. Our product uses points for the coordinate system and one inch will have 72 points in it. Thanks, ceTe Software Support Team.

Re: Default location of PageElements

Forum member · Mar 15, 2007
Hello, >>All the page elements will be added to the PDF document according to the X, Y coordinates given to them. Where are those X and Y properties? Do I need to set them on the PdfPage I create the ImportedPageDataObject from? Setting XOffset and YOffset to 0 just doesn't work. Best regards, Martin

Re: Default location of PageElements

Support · Mar 15, 2007
Hello Martin, Page elements will have X, Y properties and also you can set these in the Page element's constructor. ImportedPageData will have XOffset and YOffset. Following is the sample code to use this ImportedPageData. Document document = new Document(); Page page = new Page(); document.Pages.Add( page ); ImportedPageData data = new ImportedPageData(@"C:/Temp/DocA.pdf", 100, 200, 1); page.Elements.Add( data ); document.DrawToWeb(); Here 100, and 200 are XOffset, YOffset positions. You can refer to the Placing Imported Pages topic on our help documentation. Thanks, ceTe Software Support Team.

Re: Default location of PageElements

Forum member · Mar 21, 2007
Dear moderator, all you said is valid for ImportedPageArea objects but not for ImportedPageData objects. The latter are indeed placed in the middle of a page (see HTML documentation). I just came to it by reviewing the documentation. So, I modiefied my implementation to use ImportedPageArea objects and all is fine now! Kind regards, Martin