Back to Devexpress

PdfDocumentProcessor.AppendDocument(Stream) Method

officefileapi-devexpress-dot-pdf-dot-pdfdocumentprocessor-dot-appenddocument-x28-system-dot-io-dot-stream-x29.md

latest4.4 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public void AppendDocument(
    Stream stream
)
vb
Public Sub AppendDocument(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

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.

Example

csharp
using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor()) {
      pdfDocumentProcessor.CreateEmptyDocument("..\\..\\docs\\Merged.pdf");
      pdfDocumentProcessor.AppendDocument( new FileStream("..\\..\\docs\\TextMerge1.pdf",
        FileMode.OpenOrCreate));
}
vb
Using pdfDocumentProcessor As New PdfDocumentProcessor()
      pdfDocumentProcessor.CreateEmptyDocument("..\..\docs\Merged.pdf")
      pdfDocumentProcessor.AppendDocument(New FileStream("..\..\docs\TextMerge1.pdf", FileMode.OpenOrCreate))
End Using

The following code snippets (auto-collected from DevExpress Examples) contain references to the AppendDocument(Stream) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-core-dashboard-export-all-items/CS/AspNetCoreDashboard_ExportAllItems/Controllers/ExportController.cs#L34

csharp
exporter.ExportDashboardItemToPdf(dashboardId, dashboardItemName, stream, new System.Drawing.Size(1024, 768), dashboardState);
    documentProcessor.AppendDocument(stream);
}

web-forms-dashboard-pdf-export-with-filter-values-on-different-pages/CS/ASPxDashboard_ServerExport/Default.aspx.cs#L41

csharp
exporter.ExportToPdf("Dashboard", stream, new System.Drawing.Size(1024, 768), dashboardState, pdfOptions);
    documentProcessor.AppendDocument(stream);
}

office-file-api-in-web-api-app/CS/Controllers/PdfController.cs#L23

csharp
stream.Seek(0, SeekOrigin.Begin);
    processor.AppendDocument(stream);
}

web-forms-dashboard-pdf-export-with-filter-values-on-different-pages/VB/ASPxDashboard_ServerExport/Default.aspx.vb#L40

vb
exporter.ExportToPdf("Dashboard1", stream, New System.Drawing.Size(1024, 768), dashboardState, pdfOptions)
    documentProcessor.AppendDocument(stream)
End Using

See Also

PdfDocumentProcessor Class

PdfDocumentProcessor Members

DevExpress.Pdf Namespace