

You can also import pages from multiple documents and arrange the pages as required. You can download a complete working sample from GitHub.
#PLPDF MERGEX PDF#
Read ) // Creates a PDF stream for merging Stream streams = Read ) FileStream stream2 = new FileStream ( "file2.pdf", FileMode. Creates a PDF document PdfDocument finalDoc = new PdfDocument () FileStream stream1 = new FileStream ( "file1.pdf", FileMode.

However, you can merge multiple documents from stream using the following code snippet. Due to platform limitations, the PDF file cannot be loaded from disk. Refer to PDF/UWP section for respective code samples Save ( stream, "Sample.pdf" ) Close ( true ) //Save the stream as PDF document file in local machine. SaveAsync ( stream ) //Close the documents document. Merge ( document, loadedDocument ) //Save the PDF document to stream MemoryStream stream = new MemoryStream () await document. OpenAsync ( file ) //Create a new PDF document PdfDocument document = new PdfDocument () //Merge the document PdfDocumentBase. PickSingleFileAsync () //Creates an empty PDF loaded document instance PdfLoadedDocument loadedDocument = new PdfLoadedDocument () //Loads or opens an existing PDF document through Open method of PdfLoadedDocument class await loadedDocument.

Add ( ".pdf" ) //Browse and choose the file StorageFile file = await picker. Create the file open picker var picker = new FileOpenPicker () picker. However, you can merge specified document using the following code snippet.
