Top/Bottom dimensions (Trim/Art/etc boxes, and margins) reversed

Top/Bottom dimensions (Trim/Art/etc boxes, and margins) reversed

Forum member · Jul 13, 2012
Using the latest DynamicPDF Merger for .NET, I'm running in to an issue where all "Top" and "Bottom" values seem to be reversed. For example, I have a PDF that's 800pts high, produced by Illustrator 5.1 (same occurs in PDFs produced by InDesign 5.5). The trim box is 3pt from the top of the page and 5pt from the bottom of the page. However, ExtendedPageDimension's TrimBox.Top is returning "5.0" and TrimBox.Bottom is returning "797.0" - expectation would be "3.0" for the top and "795.0" for the bottom. The same holds true for all the other boxes from ExtendedPageDimensions and, as a continuation, the TopMargin and BottomMargin. This is causing an issue as I'm using DynamicPDF to place a label on the page at a given position relative to the trim box. To do this, I would ideally like to be able to set the Dimensions.TopMargin to the TrimBox.Top, but this only works when the TrimBox is "symmetric" and the same distance in from the top and bottom - if it's not, the label ends up offset by the difference between the two. As a work around, I'm setting Dimensions.Top to Dimensions.Height - TrimBox.Bottom. Anyone else running in to this issue? (I didn't encounter it until a while in to testing, as everything I was testing on was "symmetric" so the top and bottom values were all the same - it wasn't until I started having asymmetric values that the issue emerged.) Thanks!

Re: Top/Bottom dimensions (Trim/Art/etc boxes, and margins) reversed

Support · Jul 13, 2012
Hello, We have not seen this issue before. Please email the following and any other relevant info related to this issue to [^a|mailto:support@cete.com|opennewwindow|support@cete.com^] so we can investigate this further. 1.Input PDF document. 2.Code used 3.Output PDF document. Thanks, ceTe Software Support Team.

Re: Top/Bottom dimensions (Trim/Art/etc boxes, and margins) reversed

Support · Dec 11, 2012
Hello, On further analysis it has been determined that there is a bug in the way dimensions are handled. The following workaround should resolve this issue until a permanent fix is released. MergeDocument document = new MergeDocument(fileName); Page page = document.Pages[0]; ExtendedPageDimensions epd = page.Dimensions as ExtendedPageDimensions; page.Dimensions.LeftMargin = epd.TrimBox.Left; page.Dimensions.RightMargin = epd.TrimBox.Right; page.Dimensions.TopMargin = page.Dimensions.Height - epd.TrimBox.Bottom; Label label = new Label("Test stamp", 0, 0, (float)100, (float)12, Font.Helvetica, 12); page.Elements.Add(label); document.Draw("test.pdf"); Thanks, ceTe Software Support Team.