.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PdfDocumentProcessor.AppendDocument(Stream) Method

Appends a PDF document located at the specified file stream to the end of the current document starting from the new page.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Docs.v21.1.dll

Declaration

public void AppendDocument(
    Stream stream
)

Parameters

Name Type Description
stream Stream

A Stream value, specifying the location of the appended document.

Remarks

All additional content (interactive forms, bookmarks,hyperlinks, file attachments, etc.) of the appended document is copied to the resulting file.

This example illustrates how to use the PDF Document API component to merge pages of two separate PDF documents into a single PDF document.

using DevExpress.Pdf;

namespace PdfMergeExample {

    class Program {
        static void Main(string[] args) {

            using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor()) {
                pdfDocumentProcessor.CreateEmptyDocument("..\\..\\docs\\Merged.pdf");
                pdfDocumentProcessor.AppendDocument("..\\..\\docs\\TextMerge1.pdf");
                pdfDocumentProcessor.AppendDocument("..\\..\\docs\\TextMerge2.pdf");             
            }
        }
    }
}
See Also