Appends a PDF to the end of the document.

 

   

Syntax
 

[C#]
virtual void Append(Doc doc)

[Visual Basic]
Overridable Sub Append(doc As Doc)

 

   

Params
 
Name Description
doc

The document to add to the end of this one.

 

   

Notes
 

Use this method to append one PDF to the end of another one.

Individual pages from one PDF can be drawn into another using the AddImageDoc method.

If you are inserting a number of pages it is much faster to use the Append method than to draw pages individually. It also has the advantage of maintaining other information such as bookmarks.

If you are inserting pages that contain form fields, you may want to call MakeFieldsUnique to avoid sharing fields across pages.

The Refactor setting determines whether new/modified redundant objects are eliminated when the document is appended to. Unless the documents are big in terms of memory use and have many common objects, it is faster to disable refactoring for appending documents and enable it for saving the final document. You can use SetInfo to change the setting.

 

   

Example
 

The following code snippet illustrates how one might join two PDF documents together.

[C#]
Doc theDoc1 = new Doc();
theDoc1.FontSize = 192;
theDoc1.HPos = 0.5;
theDoc1.VPos = 0.5;
theDoc1.AddText("Hello");
Doc theDoc2 = new Doc();
theDoc2.FontSize = 192;
theDoc2.HPos = 0.5;
theDoc2.VPos = 0.5;
theDoc2.AddText("World");
theDoc1.Append(theDoc2);
theDoc1.Save(Server.MapPath("docjoin.pdf"));
theDoc1.Clear();
theDoc2.Clear();

[Visual Basic]
Dim theDoc1 As Doc = New Doc()
theDoc1.FontSize = 192
theDoc1.HPos = 0.5
theDoc1.VPos = 0.5
theDoc1.AddText("Hello")
Dim theDoc2 As Doc = New Doc()
theDoc2.FontSize = 192
theDoc2.HPos = 0.5
theDoc2.VPos = 0.5
theDoc2.AddText("World")
theDoc1.Append(theDoc2)
theDoc1.Save(Server.MapPath("docjoin.pdf"))
theDoc1.Clear()
theDoc2.Clear()


docjoin.pdf [Page 1]


docjoin.pdf [Page 2]