This project is a comprehensive demonstration of how to render DOCX, XLSX, PPTX, and PDF files in a Next.js and React.js application. It leverages the powerful @cyntler/react-doc-viewer
library to provide seamless document viewing capabilities.
- Multi-format Support: Render DOCX, XLSX, PPTX, and PDF files effortlessly.
- Local and Remote Files: Supports both local files and remote URLs for document rendering.
- Customizable Viewer: Easily customize the viewer's appearance and behavior.
Follow these steps to set up and run the project locally:
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/your-repo/doc-viewer.git cd doc-viewer
-
Install dependencies:
npm install # or yarn install
Start the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 in your browser to view the application.
You can edit the main page by modifying pages/index.js
. The page auto-updates as you save changes.
Deploy your application easily using Vercel. Follow the Next.js deployment documentation for detailed instructions.
This project includes the following demo files for testing:
To learn more about Next.js and React.js, check out the following resources:
- Next.js Documentation - Learn about Next.js features and API.
- Learn Next.js - Interactive Next.js tutorial.
- React.js Documentation - Learn about React.js fundamentals.
This project is licensed under the MIT License.
By using this project, you can easily integrate document viewing capabilities into your Next.js and React.js applications while ensuring a smooth user experience.