These source code samples are assembled by their programming language and functions they apply. ByteScout PDF Suite can merge protected PDF documents with PDF extractor SDK. It can be applied from C#. ByteScout PDF Suite is the set that includes 6 SDK products to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript.
The SDK samples given below describe how to quickly make your application do merge protected PDF documents with PDF extractor SDK in C# with the help of ByteScout PDF Suite. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Use of ByteScout PDF Suite in C# is also described in the documentation included along with the product.
The trial version of ByteScout PDF Suite can be downloaded for free from our website. It also includes source code samples for C# and other programming languages.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
using System.Diagnostics; using Bytescout.PDFExtractor; namespace MergeDocuments { // // This example demonstrates how to provide password for protected PDF files. // class Program { static void Main(string[] args) { string[] inputFiles = new string[] { @".\encrypted1 (password is 'password').pdf", @".\encrypted2 (password is 'password').pdf", }; using (DocumentMerger merger = new DocumentMerger("demo", "demo")) { // Handle `PasswordRequired` event merger.PasswordRequired += new PasswordEventHandler(merger_PasswordRequired); // Ignore document permissions merger.CheckPermissions = false; merger.Merge(inputFiles, @".\result.pdf"); } // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } static void merger_PasswordRequired(object sender, string document, ref string password) { // Ask user for password and return it using `password` parameter password = "password"; } } }
60 Day Free Trial or Visit ByteScout PDF Suite Home Page
Explore ByteScout PDF Suite Documentation
Explore Samples
Sign Up for ByteScout PDF Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout PDF Suite Home Page
Explore ByteScout PDF Suite Documentation
Explore Samples
Sign Up for ByteScout PDF Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: