Foxit pdf SDK for IOS

Integrate PDF technology easily within your iOS app with our iOS PDF SDK. Foxit’s technology comes with a UI Extension component which is a simple built in PDF viewer. This cuts down development time, making PDF libraries simple and easy to understand, even for those with limited knowledge of PDF technology. Choosing Foxit PDF SDK for your next project means working with a professional, easy to use software development kit that suits all your needs.

Developing with Foxit’s
iOS PDF SDK

Have all the PDF technology you need for your iOS app in one place. Build a first class product, complete with full RMS capabilities and touch screen using Xcode in Swift, Objective-C, or in binding libraries like Cordova, Xamarin or React Native with Foxit. Our libraries, along with our SDK UI Extension can ensure that your application has all the PDF features and functionality it needs to satisfy your users.

PDF SDK for iOS Support

FEATURES

PDF Viewing

Our core API provides for high-fidelity rendering of PDF documents with optimized performance for desktop and mobile platforms.

Digital Signature

Use ink signatures to let customers sign documents in their digital devices. No need to print a file to sign again!

PDF Forms

Give users the ability to fill out digital forms on the go with their device of choice. Apps have never been more productive!

PDF Password Android
Strikeout annotation
Full Text Search

Rights Management

Our PDF SDK can generate secure PDFs with native encryption/decryption or integrate with customized DRM or IRM security systems. Our technology integrates with Microsoft RMS.

PDF Annotations

Our PDF SDK provides full support for annotating and marking up content with an extensive range of functions for creating, editing or importing/exporting annotations.

Full-Text Search

Fast full-text search for any PDF document, language, or encoding type. The SQLite-based full-text search delivers near-instant results, even for repositories on any digital device.

Introducing PDF SDK 6.1 FOR Web 

Foxit PDF SDK for Web 6.1 introduces a number of UI-related and Core features taking our full-JavaScript viewer to the next level with advanced functionality and performance.

Advanced Technology

XFA FORMS

XFA Forms are XML-based forms wrapped inside a PDF. Securely capture, present, move, process, output, update and print information associated with static and dynamic XFA forms. Simplify your data sharing, transportation and availability with XFA.

RIGHTS MANAGEMENT

Keep your PDF documents secure by connecting your application and files to Microsoft's Rights Management Services platform natively. Foxit PDF SDK also integrates with your IRM and DRM solution.

OCR

Convert scanned documents to searchable text PDFs with our highly accurate enterprise optical character recognition (OCR) software. Designed for scanning, and archiving, our robust functionality outputs 13 different file formats including PDF & PDF/A.

REDACTION

Programmatically search and sensor sensitive information in a document for legal or security purposes to keep your customer and employee information safe.XFA.
Achieve full GDPR-compliance.

CONNECTED PDF

Leverage Foxit's cutting-edge technology that powers document intelligence, security and collaboration services, programmatically, for PDF files. Secure files, access analytics, and collaborate in real time, all within one SDK.

CONVERSION

Leverage our conversion and compression technology to speed up file conversion and archiving. Convert TIFF, JPEG, Word, Email, HTML, ASCII text and more to file formats including PDF and PDF/A.

XFA FORMS

XFA Forms are XML-based forms wrapped inside a PDF. Securely capture, present, move, process, output, update and print information associated with static and dynamic XFA forms. Simplify your data sharing, transportation and availability with XFA.

Rights Management

Keep your PDF documents secure by connecting your application and files to Microsoft’s Rights Management Services platform natively. Foxit PDF SDK also integrates with your IRM and DRM solution.

OCR

Convert scanned documents to searchable text PDFs with our highly accurate enterprise optical character recognition (OCR) software. Designed for scanning, and archiving, our robust functionality outputs 13 different file formats including PDF & PDF/A.

REDACTION

Programmatically search and sensor sensitive information in a document for legal or security purposes to keep your customer and employee information safe. Achieve full GDPR-compliance.

CONNECTEDPDF

Leverage Foxit's cutting-edge technology that powers document intelligence, security and collaboration services, programmatically, for PDF files. Secure files, access analytics, and collaborate in real time, all within one SDK.

CONVERSION

Leverage our conversion and compression technology to speed up file conversion and archiving. Convert TIFF, JPEG, Word, Email, HTML, ASCII text and more to file formats including PDF and PDF/A.

Try our Technology

Our iOS PDF Reader is built with our PDF SDK for iOS and free to download from the app store. Try our technology today.

Benefits

Native UI

Our iOS PDF SDK is built with development in mind. We provide a built in PDF viewer which will half your development while allowing you to customize your viewer accordingly.

Easy to Integrate

We developed our iOS PDF Library with platform considerations a priority. This means that we follow IOS specific naming conventions to make our product native to it.

NATURAL PDFKIT UPGRADE

If you use PDFKit in your iOS or Mac application, it may be time for an upgrade. Foxit PDF SDK offers better rendering quality, as well as an extensive feature list including annotations, forms, signatures and more.

Powered by Foxit's Technology

The core technology of Foxit PDF SDK has been around for years and is trusted by a large number of well-known companies, Foxit’s powerful engine makes document viewing fast and consistent in all environments.

SYSTEM REQUIREMENTS

  • iOS 9.0 or higher
  • Xcode 9.0 or newer for Objective-C
  • Xcode 9.0 or newer for Swift

Sample Code in Xcode

    /** @brief	Edit bookmark appearances and titles, and save these changes to a PDF file. */
    func modifyBookmarkOfDoc(_ doc: FSPDFDoc, saveAsNewDocAtPath path: String) -> Bool {
        if path == "" {
            return false
        }
        let rootBMark = doc.getRootBookmark()
        guard let child = rootBMark?.getFirstChild() else {
            return false
        }
        if !(self.setPropertiesOfBookmarks(child)) {
            return false
        }
        doc.save(as: path, save_flags: 0)
        return true
    }
    
    class func parsePage(_ page: FSPDFPage, reparse: Bool) -> Bool {
        let progressive = page.startParse(0, pause: nil, is_reparse: reparse)
        if progressive == nil {
            return true
        }
        
        while true {
            let state = progressive!.resume()
            switch state {
            case .finished:
                return true
            case .toBeContinued:
                continue
            case .error:
                return false
            default:
                fatalError()
            }
        }
    } 
	
    func setPropertiesOfBookmarks(_ bookmark: FSBookmark?) -> Bool {
        if bookmark == nil {
            return false
        }
        var bk: FSBookmark!
        bk = bookmark!
        while !bk.isEmpty() {
            let title = bk.title!
            bk.title = "\(String(describing: title))_renamed" as NSString
            bk.color = 0x0000ffff
            bk.style = UInt32(FSBookmarkStyle.bold.rawValue)
            
            let child = bk.getFirstChild()!
            if !child.isEmpty() {
                self.setPropertiesOfBookmarks(child)
            }
            bk = bk!.getNextSibling()
        }
        return true
    } 
    /** @brief	Render a specified page to Bitmap, and save it to a PNG image. */
    func renderPage(_ page: FSPDFPage, atPath path: String) -> Bool {
        if path == "" {
            return false
        }
        if !page.isParsed() {
            if !PlatformAPIDemo.parsePage(page, reparse: true) {
                return false
            }
        }
        //create bitmap
        let pageWidth: Int = Int(page.getWidth())
        let pageHeight: Int = Int(page.getHeight())
        
        let bmp = FSBitmap(width: Int32(pageWidth), height: Int32(pageHeight), format: .dibRgb32, buffer: nil, pitch: 0)!
        
        bmp.fillRect(0xffffffff, rect: nil)
        //init renderer
        let render = FSRenderer.init(bitmap: bmp, is_rgb_order: true) 
        if render == nil {
            return false
        }
        
        //set different kinds of properties
        render!.setRenderContentFlags(1)
        render!.setTransformAnnotIcon(true)
        render!.setColorMode(FSRendererColorMode.normal)
        render!.setMappingModeColors(0xffffffff, foreground_color: 0x0000ffff)
        render!.setForceHalftone(true)
        let mat = page.getDisplayMatrix(0, top: 0, width: Int32(pageWidth), height: Int32(pageHeight), rotate: .rotation0)
        let progressive = render!.startRender(page, matrix: mat, pause: nil)
        if progressive != nil {
            while true {
                let state = progressive!.resume()
                if state == .error {
                    return false
                } else if state != .toBeContinued {
                    break;
                }
            }
        }
        if !self.save2PNGWithBitmap(bmp, transform: nil, Path: path as NSString) {
            return false
        }
        return true
    } 
	
    func save2PNGWithBitmap(_ fsBitmap: FSBitmap, transform: CGAffineTransform?, Path path: NSString) -> Bool {
        if path == "" {
            return false
        }
        let pageWidth: Int = Int(fsBitmap.getWidth())
        let pageHeight: Int = Int(fsBitmap.getHeight())
        if pageWidth <= 0 || pageHeight <= 0 {
            return false
        }

        let provider = CGDataProvider.init(data: fsBitmap.getBuffer() as CFData)
        
        let image = CGImage(width: pageWidth, height: pageHeight, bitsPerComponent: 8, bitsPerPixel: 32, bytesPerRow: Int(fsBitmap.getPitch()), space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: .byteOrder32Big, provider: provider!, decode: nil, shouldInterpolate: true, intent: .defaultIntent)!
        let uiImage = UIImage(cgImage: image)
        let fileURL = URL(fileURLWithPath: path as String)
        do {
            try UIImagePNGRepresentation(uiImage)!.write(to: fileURL)
        } catch {
            print(error)
            return false
        }
        return true
    }