As part of the KDAN ecosystem, ComPDF SDK for iOS provides a robust Objective-C PDF library for developers who need to build viewing, annotation, editing, form, and signing workflows in iOS apps.
The ComPDF iOS PDF Library combines native Objective-C APIs with production-ready PDF components so teams can integrate document features faster.
ComPDF SDK seamlessly operates on Web, Windows, Android, iOS, Mac, and Server, with support for cross-platform frameworks such as React Native, Flutter, etc.
If you find ComPDF SDK useful, please consider giving us a ⭐ Star on GitHub — it helps us grow and improve! Got questions or ideas? Join the conversation in our Discussions.
Why ComPDF SDK for iOS?
-
Easy to Integrate: Integrate PDF functionalities easily with our powerful SDK and clear documentation and guides with few lines of code.
-
Fully Customizable UI: Design a unique interface for your products with fully customizable UI source code by a high-performing SDK.
-
Comprehensive PDF Features: Supports generation, viewing, annotation, page editing, content editing, conversion, OCR, redaction, signing, forms, parsing, measurement, compression, comparison, color separation, batch processing, and more.
-
Faster Time-to-Market: Comprehensive SDK libraries save your time and expenses and roll out your applications and projects.
-
High-quality Service: We provide 24/7 professional one-to-one technical support, including onsite service and remote assistance via phone and email.
- Related
- Preview
- Requirements
- Run the Demo
- How to Make an iOS App in Objective-C
- Samples
- Changelog
- Free Trial and License
- Support
- ComPDF PDF Library for Android
- ComPDF SDK - Flutter Library
- ComPDF SDK - React Native Library
- How to Build an iOS PDF Viewer or Editor in Objective-C
- [How to Build an iOS PDF Viewer or Editor in Swift
ComPDF SDK for iOS delivers a smooth, feature-rich PDF experience on ios devices.
ComPDF SDK for iOS requires the latest stable version of Xcode available at the time the release was made. This is a hard requirement, as each version of Xcode is bundled with a specific version of the iOS Base SDK, which often defines how UIKit and various other frameworks behave.
- iOS 10.0 or higher.
- Xcode 13.0 or newer for Objective-C or Swift.
ComPDF SDK for iOS provides multiple demos in Objective-C for developers to learn how to call the SDK on iOS. You can find them in the "Examples/Objective-C" folder.
In this guide, we take "PDFViewer" as an example to show how to run it in Xcode (The demo in Objective-C uses the "xcodeproj" method, so you can directly open "PDFViewer.xcodeproj").
-
Copy the applied "license_key_ios.xml" file to "Examples" folder to replace (There is already a method to parse the xml file in demo, please do not modify the storage location and file name).
-
Find "PDFViewer.xcodeproj" in the "Examples/Objective-C" folder and double-click to open it, find the schemes of "PDFViewer" in Xcode, and select the corresponding simulator (ComPDF does not support the simulator to run M1 chip, but we have made it compatible in
Excluded Architectures, you can see the processing method in Troubleshooting.
-
Click Product -> Run to run the demo on an iOS device. In this guide, we use an iPhone 14 device as an example. After building the demo successfully, the "PDF32000_2008.pdf" file will be opened and displayed.

Note: This is a demo project, presenting completed ComPDF SDK functions. The functions might be different based on the license you have purchased. Please check that the functions you choose work fine in this demo project.
This section will help you to quickly get started with ComPDF SDK to make an iOS app in Objective-C with step-by-step instructions, which include the following steps:
- Create a new iOS project in Objective-C.
- Integrate ComPDF into your apps.
- Apply the license key.
- Display a PDF document.
In this guide, we use Xcode 12.4 to create a new iOS project.
- Fire up Xcode, choose File -> New -> Project..., and then select iOS -> Single View Application. Click Next.
- Choose the options for your new project. Please make sure to choose Objective-C as the programming language. Then, click Next.
- Place the project to the location as desired. Then, click Create.
To add the dynamic xcframework "ComPDF.xcframework" into the "PDFViewer" project, please follow the steps below:
-
Right-click the "PDFViewer" project, select Add Files to "PDFViewer"....

-
Find and choose "ComPDF.xcframework" in the download package, and then click Add. Note: Make sure to check the Copy items if needed option.

-
Then, the "PDFViewer" project will look like the following picture.

-
Add the dynamic xcframework "ComPDF.xcframework" to the Xcode's Embedded Binaries. Left-click the project, find Embedded Binaries in the General tab, and choose Embed & Sign.

-
For earlier versions of Xcode (like Xcode 13), the Bitcode option might be turned on by default, which requires it to be turned off to run. The precise steps to do this are illustrated as shown in the picture below.

Contact ComPDF's sales team to get a license for free to test this project.
-
Import the header file "ComPDF/ComPDF.h" to
AppDelegate.m. -
Follow the code below and call the method
CPDFKit verifyWithKey:@"LICENSE_KEY"in- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions. You need to replace the LICENSE_KEY with the license you obtained.#import <ComPDFKit/ComPDFKit.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Set your license key here. ComPDFKit is commercial software. // Each ComPDFKit license is bound to a specific app bundle id. // com.compdfkit.pdfviewer [CPDFKit verifyWithKey:@"YOUR_LICENSE_KEY_GOES_HERE"]; return YES; }
-
Compile and run the project. If the console outputs "version information", it means that the license has been set successfully. Otherwise, please check "[Troubleshooting](#2.4.5 Troubleshooting)" or check error logs in the console to quickly identify and solve the issue.
So far, we have added "ComPDF.xcframework" to the "PDFViewer" project and finished the initialization of the ComPDF SDK. Now, let’s start building a simple PDF viewer with just a few lines of code.
-
Prepare a test PDF file, and drag and drop it into the newly created PDFView project. In this way, you can load and preview the local PDF document using
NSBundle. The following image shows an example of importing a PDF document named “Online5” into the project.
-
Import
<ComPDFKit/ComPDFKit.h>at the top of yourUIViewController.msubclass implementation:#import <ComPDFKit/ComPDFKit.h>
-
Create a
CPDFDocumentobject through NSURL, and create aCPDFViewto display it. The following code shows how to load PDF data using a local PDF path and display it byCPDFView.NSBundle *bundle = [NSBundle mainBundle]; NSString *pdfPath= [bundle pathForResource:@"Online5" ofType:@"pdf"]; NSURL *url = [NSURL fileURLWithPath:pdfPath]; CPDFDocument *document = [[CPDFDocument alloc] initWithURL:url]; CGRect rect = self.view.bounds; CPDFView *pdfView = [[CPDFView alloc] initWithFrame:rect]; pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; pdfView.document = document;
-
Add the created
CPDFViewto the view of the current controller. The sample code is shown below.[self.view addSubview:pdfView];
-
The code shown here is a collection of the steps mentioned above:
- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSBundle *bundle = [NSBundle mainBundle]; NSString *pdfPath= [bundle pathForResource:@"Online5" ofType:@"pdf"]; NSURL *url = [NSURL fileURLWithPath:pdfPath]; CPDFDocument *document = [[CPDFDocument alloc] initWithURL:url]; CGRect rect = self.view.bounds; CPDFView *pdfView = [[CPDFView alloc] initWithFrame:rect]; pdfView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; pdfView.document = document; [self.view addSubview:pdfView]; }
-
Connect your device or simulator, and use the shortcut Command_R to run the App. The PDF file will be opened and displayed.

-
Bitcode Even when all configurations are correct, there may still be compilation errors. First, check if the Bitcode is disabled. In earlier versions of Xcode (such as Xcode 13), the Bitcode option may be enabled by default. It needs to be set to No in order to run the app.
-
License If a License setting error occurs, ensure that the Identity (Bundle ID) setting in General matches the Bundle ID you provided when contacting us for the license. If an expired License message appears, please contact the ComPDF team to obtain the latest License and Key.
-
Cannot Run on i386 Architecture Simulator The version of Xcode 12.5 or newer, doesn't support i386 simulators. Apple dropped the i386 after switching to ARM processors and no longer maintains i386 architecture simulators. Please use ARM simulators or x86_64 architecture simulators to test and develop your program. So you need to search for Excluded Architectures in Build Settings in TARGETS, and then double-click it. A pop-up window will be popped up, click the plus sign (as shown below) to add i386.

-
No PDF Displayed Check if the special encoding is required in the path we passed in, or if the local path we passed in exists.
-
Other Problems If you meet some other problems when integrating our ComPDF SDK for iOS, feel free to contact ComPDF's support team.
There are many samples in the Samples folder that demonstrate the main features of the ComPDF API and how to use them, such as adding watermarks, comments, forms, etc. to PDFs. You can copy the code, add it to your project and run it directly. Or, you can get our code examples for iOS. To learn more about the ComPDF API, please visit our API Reference.
Keep up with the latest updates, improvements, and bug fixes for ComPDF SDK for iOS: View iOS Changelog
ComPDF SDK for iOS offers a 30-day free trial so you can evaluate core PDF capabilities in your own application.
To get started:
- Apply for a free trial
- Review supported trial features and licensing details
- Follow the integration and license steps above to activate the SDK in your project
For custom deployments, advanced features, or volume licensing, please contact our sales team
ComPDF has a professional R&D team that produces comprehensive technical documentation and guides to help developers. Also, you can get an immediate response when reporting your problems to our support team.
- For detailed information, please visit our Guides page.
- For technical assistance, please reach out to our Technical Support.
- To get more details and an accurate quote, please contact our Sales Team or send an email.



