The code below works fine when I use a new page but when I use an imported page i get an invalid page number error on the last line of code. I am trying to use an existing page as a template then add new elements. Any help please this one is doing my nut.
PDFDocument = New Document
PDFDocument.Sections.Begin()
'Loop each page building the pdf file
For Each Page
Dim PDFPage As Page = New ImportedPage(TemplateLocation, 1)
' Create a Page and add it to the document
PDFPage.Dimensions.Width = 750
PDFPage.Dimensions.SetMargins(35, 10, 35, 0)
PDFDocument.Pages.Add(PDFPage)
'Add each element
For Each Element
PDFPage.Elements.Add(New Label(ElementName, Element.Xcord, Element.YCord, _
Element.Width, Element.Height, Font.Helvetica, Element.FontSize))
Next
'Reset page
PDFPage = Nothing
Next
PDFDocument.Draw(PDFNAME.pdf")