CoolFace
Apppublic

PaddlePaddle/doc2page

sourceHugging Faceapache-2.0updated 10mo agoView on Hugging Face
10likes
App README

๐Ÿ“„โžก๏ธ๐ŸŒ Doc2Page - Document to Webpage Converter

Convert your PDF documents or images into beautiful, responsive HTML webpages!

โœจ Features

  • โ€”๐Ÿ“– Smart OCR: Extract text from PDFs and images using PaddleOCR
  • โ€”๐Ÿค– AI Enhancement: Transform content into well-structured HTML using ERNIE
  • โ€”๐ŸŽจ Beautiful Output: Generate responsive, styled webpages with modern CSS
  • โ€”๐Ÿš€ Easy Deployment: Optional one-click deployment to GitHub Pages
  • โ€”๐Ÿ“ฑ Mobile Friendly: Responsive design that works on all devices

๐Ÿ”ง How It Works

  1. 1.Upload: Drop your PDF or image file
  2. 2.Extract: PaddleOCR extracts text and structure
  3. 3.Transform: ERNIE converts to beautiful HTML
  4. 4.Deploy: Optionally publish to GitHub Pages

๐Ÿ“ Supported Formats

  • โ€”PDFs: .pdf
  • โ€”Images: .png, .jpg, .jpeg, .bmp, .tiff

๐Ÿš€ Quick Start

  1. 1.Upload a document using the file picker
  2. 2.Click "Convert to Webpage"
  3. 3.Preview your generated webpage
  4. 4.Download the HTML file
  5. 5.Optionally deploy to GitHub Pages

โš™๏ธ Configuration

Setup using .env file:

  1. 1.Copy the example environment file:
bash
cp .env.example .env
  1. 1.Edit the .env file with your credentials:
bash
# Required API Configuration for PP-StructureV3
API_URL=your_pp_structurev3_api_url
API_TOKEN=your_api_token

# Optional ERNIE API Configuration for enhanced HTML generation
ERNIE_CLIENT_ID=your_client_id_here
ERNIE_CLIENT_SECRET=your_client_secret_here

Note: The .env file is automatically loaded when the application starts. Without ERNIE credentials, the app will use a high-quality fallback HTML generator.

๐Ÿ—๏ธ Technical Stack

  • โ€”Frontend: Gradio for the web interface
  • โ€”OCR Engine: PP-StructureV3 API (PaddlePaddle)
  • โ€”AI Processing: ERNIE 4.5-X1.1-Preview (optional)
  • โ€”Image Processing: Pillow

๐Ÿ“ Example Use Cases

  • โ€”Convert research papers to web format
  • โ€”Digitize scanned documents
  • โ€”Create web-friendly versions of presentations
  • โ€”Transform printed materials to responsive websites
  • โ€”Archive documents in searchable HTML format

๐Ÿ“„ License

This project is licensed under the Apache 2.0 License.