Page Class | Page Elements | Programming with Merger for COM/ActiveX

New content can be added to a document in several different ways. New pages can be added to existing documents and new Page Elements can be added to any imported page or page in an imported PDF document.

Adding New Pages to An Existing PDF Document

New pages can be added to the imported PDF document. Page Elements can then be placed on these pages. It is also possible to add existing pages from a separate PDF document using the LoadPdf or AppendPdf methods of Document class.

The following code shows how to add a new page to a PDF document.

[ASP - VBScript]
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
    Dim MyDocument
    Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
    MyDocument.LoadPdf Server.MapPath( "PDFs/DocumentA.pdf" )
    Dim MyPage
    Set MyPage = MyDocument.AddPage()
    MyPage.AddLabel "Last Page", 0, 0, 512, 12
    MyDocument.DrawToWeb
    Set MyPage = Nothing
    Set MyDocument = Nothing
%>

Adding New Content to An Existing PDF Page

New content can be added to any imported page from an existing PDF document. This is accomplished by adding Page Elements to the imported page which we can access in the Document using GetPage() method.

The following code shows how to adds new content to an existing page in a PDF document.
[ASP - VBScript]
<!-- METADATA TYPE="typelib" UUID="{DF9225FE-94A4-490D-8CAD-E8366CE621D3}"-->
<%
    Dim MyDocument
    Set MyDocument = Server.CreateObject( "DynamicPDF.Document" )
    Dim MyPage
    Set MyPage = MyDocument.AddImportedPage( Server.MapPath( "PDFs/DocumentA.pdf" ), 1 )
    MyPage.AddLabel "New Content", 0, 0, 512, 12
    MyDocument.DrawToWeb
    Set MyPage = Nothing
    Set MyDocument = Nothing
%>

See Also 

Page Class | Page Elements | Programming with Merger for COM/ActiveX