1. Products
  2.   PDF
  3.   Swift
  4.   TPPDF
 
  

Free PDF Creation, Editing & Conversion via Swift Library.

Open Source Swift PDF Generation, Editing & Conversion Library that enables software developers Generate, Read, Manipulate, & & convert PDF Documents without using Adobe Acrobat in iOS applications.

PDF documents have become an integral part of modern business and communication. Whether it's creating invoices, generating reports, or sharing important information, PDFs offer a standardized way to present and share documents across different platforms and devices. To facilitate the seamless generation of PDFs in iOS apps, the TPPDF library emerges as a powerful tool. It's designed to work seamlessly with Swift, ensuring software developers can effortlessly create professional-looking PDFs for a variety of use cases, including reports, invoices, certificates, and more.

TPPDF is an open source Swift library that allows software developers to create PDF documents programmatically inside iOS and macOS apps. It provides a convenient way to design and generate PDFs with various elements like text, images, tables, and more. There are several important features part of the library such as adding Page header and footer, custom spacing, horizontal line separators, custom image size fit, images compression, managing metadata information, custom table styling, tables and cell alignment support, custom indentation and many more. The library flexible architecture and easy-to-use API make it a popular choice among software developers who need to generate dynamic PDFs on the fly.

The TPPDF library abstracts the complexities of PDF generation, saving software developers from having to manually manage layout, pagination, and other intricate details. The library ensures that the generated PDFs maintain high quality, making them suitable for professional documents and presentations. It has an active and supportive community of developers who contribute to its growth and offer assistance when needed. Its intuitive interface, coupled with its rich feature set, makes it an indispensable tool for any iOS developer aiming to enhance their app's capabilities by adding PDF generation functionality. Whether you're a novice or an experienced developer, TPPDF streamlines the process of creating visually appealing and functional PDFs. Give it a try and take your PDF generation experience to the next level.

Previous Next

Getting Started with TPPDF

The recommend way to install TPPDF is using CocoaPods. Please use the following command for a smooth installation.

Install TPPDF via CocoaPods

$ gem install cocoapods

$ pod install

You can download it directly from GitHub.

Dynamic PDF Documents Creation via Swift API

The open source TPPDF library makes it easy for software developers to create and modify PDF documents inside Swift applications. Moreover, the library makes it easy for software developers to dynamically generate PDFs with content that can change based on user input or data from an API. This is particularly useful for generating personalized documents such as sinvoices, receipts, or certificates. The following example shows how to generate a PDF document using Swift commands.

How to Generate PDF Document using Swift API?

import TPPDF

// Create a new PDF document
let pdf = PDFDocument(format: .a4)

// Add a title to the document
let title = PDFSimpleText(text: "Sample PDF Generated with TPPDF")
pdf.add(text: title)

// Add an image to the document
if let image = UIImage(named: "sampleImage") {
    let pdfImage = PDFImage(image: image)
    pdf.add(image: pdfImage)
}

// Save the PDF document to a file
let pdfURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent("sample.pdf")
try? pdf.generatePDF(to: pdfURL)

Customizable Layouts & Multi-language Support

The open source TPPDF library, has provided complete support for handling tasks related to PDF layout management. The library gives users complete control over the layout and styling of your PDF documents. You can customize fonts, colors, margins, headers, footers, and other visual aspects to match your app's design. Moreover, the library supports multi-language content, allowing software developers to create PDFs in different languages and character sets, making it suitable for apps with a global user base.

Rich Text Formatting via Swift API

TPPDF supports rich text formatting, enabling you to apply styles such as bold, italic, and underline to your text content. This is particularly useful when you need to highlight specific information in your PDFs. It is also very easy to seamlessly include images in your PDF documents, whether they are company logos, product images, or user avatars. TPPDF ensures proper scaling and positioning of images. Moreover, creating tabular data is made easy with TPPDF. You can generate tables with customizable column widths, row heights, borders, and cell content alignment.