Tutorials

How to Combine PDF Files without Adobe: 3 Ways

By ComPDFKit | Wed. 06 Nov. 2024
Document EditorSwiftPDF API

PDFs are a common format for sharing documents, but combining multiple files can take time and effort. We all know that Adobe Acrobat is a popular option, but it's not the only one—and it can't be easy to use or access. So, in this blog, we will explore 3 ways for free and easy-to-use alternatives for combining PDF files without Adobe. 

 

combine-pdf-files

 

Windows   Web   Android   iOS   Mac   Server   React Native   Flutter   Electron
30-day Free

 

 

1. Combine PDF Files on Mac with ComPDFKit PDF SDK


ComPDFKit PDF SDK is a powerful SDK library for developers, offering comprehensive features beyond simple PDF conversion. It simplifies the process of reading, editing, and annotating PDF documents, making it easier to work with PDFs in any development project. 

 

The SDK provides detailed, easy-to-follow documentation and supports various platforms, including Web, Windows, Mac, iOS, and Android. Developers can take advantage of a 30-day free trial to explore its capabilities. Plus, responsive customer support is available to assist with any issues encountered during development. Now, we'll show you how to combine PDF files on Mac quickly and easily, without needing Adobe software.

 

free-trial

 

Step 1. Build a Mac PDF editor using Swift

 

Before you get started, consult the detailed development guide from ComPDFKit to quickly and easily create a Mac PDF viewer

 

 

Then, follow the steps below to merge your PDF files.

 

Step 2. Create a blank document

 

Create a new blank PDF document in the PDF editor generated in Step 1.

 

Step 3. Open the PDF file page to be merged

 

Then open the PDF document you want to merge in the editor.

 

Step 4. Select all the pages to be merged and merge them into the same document

 

Finally, select the pages you want to merge (partial or complete) and merge them into the same document.

 

combine-pdf-page

 

Once completed, your code should look like this:

 

let mergeDocument = CPDFDocument()

if let document1 = CPDFDocument(url: URL(fileURLWithPath: "filePath1")),

   let document2 = CPDFDocument(url: URL(fileURLWithPath: "filePath2")) {

    let indexSet = IndexSet(integersIn: 0..<2)

    mergeDocument?.importPages(indexSet, from: document1, at: mergeDocument?.pageCount ?? 0)//Insert the first two pages.

    mergeDocument?.importPages(indexSet, from: document2, at: mergeDocument?.pageCount ?? 0)

}

 

If you want to complete the document merge on Windows, Web, or more platforms, please visit our comprehensive documentation library for complete steps!

 

Windows   Web   Android   iOS   Mac   Server   React Native   Flutter   Electron
30-day Free

 

 

2. Using ComPDFKit Merge API to Combine PDF Files

 

Along with using the ComPDFKit Mac SDK library to merge PDF files, you can also take advantage of the ComPDFKit Merge API, which offers a simpler method for combining your PDF documents.

 

1. Register and authentication

 

You can register a free ComPDFKit API account, which allows you to process more than 1,000 documents for free and unlimited within 30 days.

 

sign-up-api

 

ComPDFKit API uses JSON Web Tokens method for secure authentication. Get your Public Key and Secret Key from the control panel and authenticate it as follows.

 

// Create a client

let client: CPDFClient = CPDFClient(publicKey: public_key, secretKey: secret_key)

 

2. Create PDF merge tasks

 

Select the PDF merge tool and replace it with the accessToken obtained in the previous step. Replace the display language of the error message with the language type you want. Then you can get the taskId in the response data.

 

// Create a task

    // Create an example of a PDF merge task

    let taskModel = await client.createTask(url: CPDFDocumentEditor.MERGE, language: .english)

    // Get a task id

    let taskId = taskModel?.taskId ?? ""

 

3. Upload files

 

Upload the PDF files you want to merge and bind them with the task ID.

 

// Upload files

    let path = Bundle.main.path(forResource: "test", ofType: "pdf")

    let uploadFileModel = await client.uploadFile(filepath: path ?? "", language: .english, params: [CPDFFileUploadParameterKey.pageOptions.string():["1,2"]], taskId: taskId)

    // Upload files

    let uploadFileModel2 = await client.uploadFile(filepath: path ?? "",language: .english ,params: [CPDFFileUploadParameterKey.pageOptions.string():["1,2"]], taskId: taskId)

 

Note:

  • In the same task, upload multiple files (up to five). If pageOptions is not passed, it will be a multi-file merge.
  • In the same task, upload multiple files (up to five) and pageOptions, and merge the specified page numbers of multiple files.
  • The upload interface supports single-file uploads only.

 

4. Merge PDF files

 

After the file upload is completed, call this interface through the task ID to merge the files.

 

// Execute task

    let _ = await client.processFiles(taskId: taskId, language: .english)

 

5. Get task information

 

Request task status and file-related metadata based on the task ID.

 

   // Query TaskInfo

    let taskInfoModel = await client.getTaskInfo(taskId: taskId, language: .english)

}

 

When finished, your complete code should look like this:

 

// Create a client

let client: CPDFClient = CPDFClient(publicKey: public_key, secretKey: secret_key)

Task { @MainActor in

    // Create a task

    // Create an example of a PDF merge task

    let taskModel = await client.createTask(url: CPDFDocumentEditor.MERGE, language: .english)

    // Get a task id

    let taskId = taskModel?.taskId ?? ""

    // Upload files

    let path = Bundle.main.path(forResource: "test", ofType: "pdf")

    let uploadFileModel = await client.uploadFile(filepath: path ?? "", language: .english, params: [CPDFFileUploadParameterKey.pageOptions.string():["1,2"]], taskId: taskId)

    // Upload files

    let uploadFileModel2 = await client.uploadFile(filepath: path ?? "",language: .english ,params: [CPDFFileUploadParameterKey.pageOptions.string():["1,2"]], taskId: taskId)


    // Execute task

    let _ = await client.processFiles(taskId: taskId, language: .english)

    // Query TaskInfo

    let taskInfoModel = await client.getTaskInfo(taskId: taskId, language: .english)

}

 

What’s more, you can find more tutorials on merging PDF files from the ComPDFKit PDF API library, such as Java, Python, and more.

 

Windows   Web   Android   iOS   Mac   Server   React Native   Flutter   Electron
30-day Free

 

 

3. Free Online Tool to Merge PDF Files

 

Alternatively, you can also use free tools to complete the process of merging PDF files, such as PDF Reader Pro, a smart and easy-to-use PDF editor powered by ComPDFKit. It can easily help you merge, split, compress, and process PDF files.

 

pdf-reader-pro-powered-by-compdfkit

 

How to merge PDF documents using PDF Reader Pro?

 

  1. Download and install PDF Reader Pro from the official site.
  2. Launch the program and select the Merge Documents tool.
  3. Upload the PDF documents to be merged.
  4. Arrange the documents in the desired order by dragging and dropping.
  5. Select the destination of the output file and click Save.

 

 

Final Words

 

That's how to easily combine PDF files without Adobe. PDF Reader Pro is easy to use and provides a range of basic PDF editing features with the power of ComPDFKit. But the ComPDFKit PDF SDK is a more powerful solution, providing developers with unparalleled flexibility and saying goodbye to the sometimes difficult-to-use dilemma of Adobe.

 

With ComPDFKit, merging is just the beginning - with functions such as PDF to MS Office, HTML, and pictures, extracting PDF data, etc., ComPDFKit is the first choice to meet all your PDF document needs and improve document collaboration efficiency.

 

In addition, ComPDFKit provides a 30-day free trial to support you in testing your project. And well as,  offers you 24/5 online support, unlimited bug requests, and remote technical support to ensure the smooth progress of your project. Start your project now!

 

Windows   Web   Android   iOS   Mac   Server   React Native   Flutter   Electron
30-day Free