Build a Cross-Platform PDF Editor with React for Web, Desktop, and Mobile

9 min read
Build Once, Deploy Everywhere: Create a Cross-Platform PDF Editor with React

TL;DR: Want to build a PDF editor for web, desktop, and mobile without maintaining separate applications? Discover how to build a cross-platform PDF editor using React and the Syncfusion React PDF Viewer. Learn how BoldCreate helps generate the application and how Tauri packages the React application for Windows, macOS, Android, and iOS, alongside its web version.

PDFs are an essential part of business applications, from reviewing contracts and processing insurance claims to managing forms and compliance documents. Users expect to view, edit, annotate, and organize these documents wherever they work, whether in a browser, desktop application, or mobile device.

For developers, supporting all these environments can mean maintaining separate applications, duplicating features, and managing multiple release cycles.

What if you could reuse the same application code across these platforms?

In this blog, we’ll explore a cross-platform PDF editor built with a React-based UI, Syncfusion® React PDF Viewer, BoldCreate, and Tauri. You’ll learn how these technologies work together, explore the PDF editing capabilities, and see how to run and build the application for web, desktop, and mobile platforms.

Understanding the cross-platform architecture

The sample application uses a shared React and Vite frontend for its user interface and application logic. It combines Syncfusion React PDF Viewer for PDF functionality, BoldCreate for AI-assisted application generation, and Tauri for packaging the application for desktop and mobile environments.

Here’s how the technologies work together:

LayerTechnologyResponsibility
FrontendReact + ViteShared user interface and application logic.
PDF viewing and editingSyncfusion React PDF ViewerPDF rendering, annotations, forms, redaction, and document management.
PDF rendering resourcesPDFium assetsResources required for PDF rendering.
Native packagingTauriPackaging the React application for desktop and mobile.
Application generationBoldCreateAI-assisted application generation.

The application targets five platforms:

  • Web browsers
  • Windows
  • macOS
  • Android
  • iOS

The web version runs directly in a browser. For desktop and mobile, Tauri packages the shared React frontend into platform-specific applications using the available WebView.

This approach allows developers to reuse the core application code while adapting platform-specific functionality when required. It does not eliminate the need for platform-specific configuration or testing.

How BoldCreate helps

Another interesting part of this sample is its development process.

Instead of manually creating the entire application structure, BoldCreate was used to generate and assemble much of the project based on natural language requirements and specifications.

Developers can then refine the generated application, integrate Syncfusion components, and customize the implementation to meet their requirements.

Explore the PDF editing capabilities

The sample goes beyond basic PDF viewing. It demonstrates several capabilities commonly needed in document-centric applications.

Find and navigate document content

Working with lengthy PDF documents can make locating specific information difficult. The application provides:

  • Text search to find relevant content.
  • Zoom controls to adjust the document view.
  • Page thumbnails to navigate between pages.

These features help users move through documents more efficiently.

Review and annotate PDFs

The annotation tools support common document review workflows, including:

  • Highlighting important text.
  • Adding markup annotations.
  • Inserting shapes.
  • Adding comments and notes.
  • Drawing freehand annotations.

Users can mark up documents and provide feedback without switching to another application.

Create and fill PDF forms

The application supports both PDF form design and form filling.

Users can create interactive form fields or complete existing forms, making it useful for workflows such as employee onboarding, customer applications, and document submissions.

Redact sensitive information

Before sharing documents, organizations may need to remove confidential information.

The redaction workflow allows users to mark sensitive text, images, or page regions for removal. After reviewing the marked areas, users can apply the redactions to permanently remove the selected content from the PDF.

This helps prepare documents for secure sharing. Application-level access controls, auditing, and secure document storage should also be implemented where required.

Organize PDF pages

The application includes page management capabilities that allow users to:

  • Insert and delete pages.
  • Rotate pages.
  • Rearrange pages.
  • Import and extract pages.

These operations help users organize documents before sharing or archiving them.

Compare document versions

When reviewing updated contracts, reports, or other business documents, identifying changes manually can be time-consuming.

The sample includes document comparison functionality to help users identify differences between PDF versions and review changes more efficiently.

Import and export annotation and form data

The application also supports importing and exporting annotation and form data.

This makes it easier to move document-related information between workflows and integrate PDF operations with broader business applications.

For details about the individual PDF Viewer capabilities, refer to the Syncfusion React PDF Viewer documentation.

Build and run the cross-platform PDF editor

The sample application is available on GitHub. Let’s see how to configure and run it locally.

Prerequisites

Before getting started, install the following tools.

Common requirements

Platform-specific requirements

PlatformRequired tools
WindowsVisual Studio 2022 Build Tools with Desktop Development with C++, and Microsoft Edge WebView2 Runtime
macOSXcode and Xcode Command Line Tools
AndroidAndroid Studio, Android SDK, Android NDK, Android SDK Command Line Tools, and Java 17
iOSmacOS with Xcode and Xcode Command Line Tools

For iOS development, use a Mac with the required Xcode environment.

Step 1: Clone the repository

Clone the sample project from GitHub and navigate to its directory.

git clone https://github.com/syncfusion/cross-platform-pdf-editor
cd cross-platform-pdf-editor

Step 2: Install dependencies

Install the project dependencies using npm:

npm install

During installation, the project automatically runs the scripts/copy-viewer-assets.mjs script.

This script copies the required PDFium runtime files, pdfium.js and pdfium.wasm, into the public/ej2-pdfviewer-lib/ directory.

These resources are required by the PDF Viewer for PDF rendering. The script prepares them as part of the installation process, so you don’t need to copy them manually in a typical setup.

Step 3: Configure the Syncfusion license

Create a .env file from the provided sample configuration:

cp .env.example .env

Add your Syncfusion license key:

VITE_SYNCFUSION_LICENSE=YOUR_LICENSE_KEY

You can obtain a license key from your Syncfusion account after starting a trial or purchasing a license.

Step 4: Run the application

Start the development server:

npm run dev

Once the server starts, open the following address in your browser:

http://localhost:1420

You can now explore the sample application and try its PDF viewing, annotation, form design, redaction, page organization, and document comparison capabilities.

Building a cross-platform PDF editor in React
Building a cross-platform PDF editor in React

Build the application for desktop and mobile

Once you’ve verified the application in the browser, you can use the provided Tauri commands to develop and build its desktop and mobile versions.

Desktop application

Use the following commands to run and build the desktop application:

npm run desktop:dev
npm run desktop:build

These commands launch the application in desktop development mode and build the desktop application for the configured target.

PDF editor deployed as a native desktop application
PDF editor deployed as a native desktop application

Android application

Initialize the Android project and run or build the application:

npm run android:init
npm run android:dev
npm run android:build

Make sure the Android development environment and required SDK components are configured before running these commands.

iOS application

Similarly, initialize and build the iOS application:

npm run ios:init
npm run ios:dev
npm run ios:build

These commands require a properly configured macOS and Xcode environment.

PDF editor deployed as a native mobile application
PDF editor deployed as a native mobile application

Note: Desktop and mobile builds use platform-specific development tools and configurations. The shared React codebase reduces duplicated application development, but each target still requires its own build and testing process.

Extend the sample for your business application

The sample provides a starting point for building document-centric applications. You can customize its interface, integrate your business workflows, and connect it to your existing document storage or backend services.

For example, consider a contract review application.

A reviewer might open a contract in a browser, annotate important sections, and redact confidential information. Later, they might access the same document from a desktop or mobile application.

The shared React codebase helps maintain consistent application functionality across these environments. However, sharing documents and synchronizing changes between devices requires a backend or shared storage solution. You can integrate the sample with your existing services to support that workflow.

The same foundation can be extended for:

  • Contract management: Review contracts, compare revisions, and redact confidential information.
  • Document management: Search, organize, and manage business documents.
  • HR applications: Create and complete employee onboarding forms.
  • Insurance applications: Review claims, manage supporting documents, and process forms.
  • Financial applications: Handle customer documents, compliance forms, and approvals.
  • Healthcare applications: Manage patient forms, consent documents, and medical records.

Rather than building PDF functionality from scratch, development teams can start with the sample and focus on implementing the workflows their applications require.

Explore the sample project

Ready to try it yourself? Use the following resources to explore the implementation and customize the application.

You can also explore the React PDF Viewer demos to see its document viewing and editing capabilities.

Create Interactive PDF Experiences in React

Build powerful PDF viewing experiences in React with built-in support for annotations, highlighting, form filling, signatures, page navigation, thumbnails, bookmarks, and text search.

Build React PDF Viewer

Conclusion

Building a PDF editor for web, desktop, and mobile doesn’t necessarily require separate application codebases. Using React and the Syncfusion React PDF Viewer, developers can build the PDF editor from a shared codebase. BoldCreate supports the development process, while Tauri makes it possible to package the application for desktop and mobile platforms.

The sample demonstrates how to bring PDF viewing, annotation, form design, redaction, page management, and document comparison into one application. You can explore the source code, run it locally, and extend it with your own business workflows.

Explore the Cross-platform PDF editor GitHub repository and start building your own PDF application.

Frequently Asked Questions

1. Does the cross-platform PDF editor require a separate PDF processing server?

The sample uses the Syncfusion React PDF Viewer and its PDFium rendering resources. Its documented setup copies the required PDFium files into the application. Additional backend services may be needed for document storage, authentication, synchronization, or other business workflows.

2. Can I integrate my own document storage service?

Yes. You can extend the React application to connect to your existing backend or document storage service. The integration depends on your authentication, storage, and document access requirements.

3. Do I need a Mac to build the iOS application?

Yes. Building the iOS application requires macOS and the Xcode development environment.

4. Does using one codebase automatically synchronize PDF changes across devices?

No. A shared codebase provides consistent application functionality, but document synchronization requires a shared backend or storage solution to manage files and changes across devices.

5. Can I customize the sample for my own PDF application?

Yes. You can customize the React interface, extend the PDF editing workflows, and integrate your own business logic and services to build applications for your requirements.

Sumathi Uthayakumar

Sumathi Uthayakumar is a software developer at Syncfusion since March 2020, focused on creating reliable, user‑oriented solutions. She brings strong problem‑solving skills, a commitment to quality, and a continuous drive to grow and contribute effectively in modern development environments.

More posts by Sumathi Uthayakumar

Create Interactive PDF Experiences in React

Build powerful PDF viewing experiences in React with built-in support for annotations, highlighting, form filling, signatures, page navigation, thumbnails, bookmarks, and text search.

Build React PDF Viewer