Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. React Native
  3. react-native-html-to-pdf

react-native-html-to-pdf

MITKotlinv1.3.0

A React Native library for converting HTML strings into PDF documents directly on mobile devices.

GitHubGitHub
460 stars274 forks0 contributors

What is react-native-html-to-pdf?

react-native-html-to-pdf is a React Native library that converts HTML strings into PDF documents directly within mobile applications. It solves the need for generating printable content like reports or invoices on iOS and Android devices without relying on external services. The library provides customizable options for document dimensions, styling, and output formats.

Target Audience

React Native developers building mobile applications that require on-device PDF generation, such as apps for invoicing, reporting, or document creation.

Value Proposition

Developers choose this library for its simplicity, platform-specific customization options, and seamless integration into React Native projects, eliminating the need for complex native modules or external PDF generation services.

Overview

Convert html strings to PDF documents using React Native

Use Cases

Best For

  • Generating invoices or receipts in React Native apps
  • Creating printable reports from dynamic data in mobile applications
  • Converting user-generated HTML content into PDFs on iOS and Android
  • Building document generation features without external dependencies
  • Adding PDF export functionality to React Native business apps
  • Customizing PDF styling with platform-specific options

Not Ideal For

  • Projects requiring advanced PDF features like encryption, watermarks, or multi-page headers/footers
  • Applications that need server-side or batch PDF generation for high scalability
  • Scenarios where pixel-perfect, cross-platform PDF consistency is critical due to differing iOS and Android options

Pros & Cons

Pros

Lightweight and Simple API

Offers a clean, promise-based API with minimal setup, as demonstrated in the straightforward usage example that requires just a few lines of code.

Platform-Specific Customization

Provides iOS-specific padding and background color options, and Android-specific custom font support, allowing tailored PDF generation per platform directly from the README options table.

Flexible Output Handling

Enables saving PDFs to custom directories, generating base64 strings, and setting custom filenames, giving developers control over output storage and format.

Custom Document Dimensions

Allows setting exact height and width in points for the PDF document, ensuring control over the final document size as shown in the options configuration.

Cons

Limited iOS Directory Support

On iOS, only the 'Documents' directory is accepted for custom paths, restricting file storage flexibility and potentially complicating file management.

Base64 Not Recommended

The README explicitly warns that returning base64 strings is 'not recommended,' limiting reliable use for in-memory PDF data handling or real-time streaming.

Platform Inconsistency

Features like padding are iOS-only and custom fonts are Android-only, which can lead to fragmented development and testing efforts for truly cross-platform apps.

Frequently Asked Questions

Quick Stats

Stars460
Forks274
Contributors0
Open Issues5
Last commit3 months ago
CreatedSince 2015

Tags

#ios#html-to-pdf#android#document-generation#react-native#mobile-development#cross-platform#pdf-generation

Built With

R
React Native

Included in

React Native35.6k
Auto-fetched 1 day ago

Related Projects

react-native-hyperlinkreact-native-hyperlink

A <Hyperlink /> component for react-native that makes urls, fuzzy links, emails etc clickable

Stars813
Forks85
Last commit3 months ago
react-native-markdown-displayreact-native-markdown-display

React Native 100% compatible CommonMark renderer

Stars789
Forks204
Last commit2 months ago
react-native-responsive-fontsizereact-native-responsive-fontsize

🔠 Responsive fontSize based on screen-size of the device in React-Native

Stars739
Forks39
Last commit4 months ago
react-native-file-viewerreact-native-file-viewer

Native file viewer for React Native. Preview any type of file supported by the mobile device.

Stars447
Forks111
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub