More Premium Hugo Themes Premium React Themes

React Native Html To Pdf

Convert html strings to PDF documents using React Native

React Native Html To Pdf

Convert html strings to PDF documents using React Native

Author Avatar Theme by christopherdro
Github Stars Github Stars: 459
Last Commit Last Commit: Sep 4, 2025 -
First Commit Created: Feb 24, 2024 -
React Native Html To Pdf screenshot

Overview:

React-native-html-to-pdf is a library that allows users to convert HTML strings to PDF documents using React Native. This tool simplifies the process of generating PDFs from HTML content for mobile applications.

Features:

  • Automatic linking with react-native link
  • Manually integrate for iOS and Android
  • Customizable filename and output directory
  • Option to return base64 string of PDF file
  • Adjustable document dimensions for height and width
  • Customizable padding for iOS
  • Custom font integration for Android
  • Dynamic permission handling for Android M and above

Installation:

To install the react-native-html-to-pdf library, you can follow these steps:

  1. Run npm install react-native-html-to-pdf --save in your project directory.

  2. For automatic linking, run react-native link.

  3. For manual integration on iOS:

    • Add libRNHTMLtoPDF.a to Build Phases -> Link Binary With Libraries in XCode.
    • Update android/settings.gradle and android/app/build.gradle.
    • Adjust MainApplication.java and AndroidManifest.xml as mentioned.
  4. For Android-specific font customization, provide an array of custom fonts in the appropriate format.

Summary:

React-native-html-to-pdf is a versatile tool for React Native developers to convert HTML strings to PDF documents effortlessly. With features like automatic and manual integration, customizable output options, and platform-specific settings, this library offers flexibility and ease of use for PDF generation in mobile applications.