keep getting extra page

keep getting extra page

Forum member · Sep 8, 2008
I keep getting an extra page at the end. This time , I started a new project and have yet to fill in the data. So far, it's just one page, but when I render, I get 2 pages of the same thing. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim CompletedOrderID As Integer = 0 If Not Context.Request.QueryString("coid") Is Nothing Then CompletedOrderID = Convert.ToInt32(Context.Request.QueryString("coid")) Dim document As Document = New Document With document .Creator = "Page_PDF_ShippingTicket" .Author = "Jim Kirker" .Title = "Shipping Ticket" .Template = headerTemplate .InitialPage = 1 .InitialPageZoom = PageZoom.FitBox .Subject = "ICE5 Software Shipping Ticket" .Title = "Order Processing - Shipping Ticket" End With AddNewPage(document, CompletedOrderID) SetPageHeaderTemplate(document, CompletedOrderID) SetPageFooterTemplate() Create_ShippingInformation(document, CompletedOrderID) Create_ShipToInformation(document, CompletedOrderID) document.Pages.Add(CurrentPage) document.DrawToWeb("PDF_ShippingTicket.pdf") End If End Sub Private Sub AddNewPage(ByVal document As Document, ByVal CompletedOrderID As Integer) 'Adds a new MyPage to the MyDocument CurrentY = 240 CurrentPage = New ceTe.DynamicPDF.Page(PageDimensions) document.Pages.Add(CurrentPage) 'CurrentPage.Elements.Add(New LayoutGrid()) End Sub

Re: keep getting extra page

Support · Sep 8, 2008
Hello, The reason you see two pages is because you are making call to the AddNewPage() method before adding any data. This will add the page once and after filling the data you are again adding the page. Comment the "document.Pages.Add(CurrentPage)" line from your code before calling the DrawToWeb method and that will solve your problem. Thanks, ceTe Software Support Team