The Enhanced PDF Viewer & Converter is a desktop application designed to provide a user-friendly interface for viewing, navigating, and converting PDF and Word documents. Built using Python and PyQt5, this application combines the power of document manipulation with an intuitive graphical interface, making it easy to manage PDFs and Word files.
- Page Navigation:
- Easily navigate through pages using Previous Page and Next Page buttons.
- Directly jump to a specific page by entering the page number in the Page Spin Box.
- Zoom Controls:
- Use the Zoom In and Zoom Out buttons or the Zoom Slider to adjust the zoom level from 50% to 300%.
- The current zoom percentage is displayed in real-time.
- Smooth Scrolling:
- A scrollable area lets you easily view large pages with smooth horizontal and vertical scrolling.
- Convert a PDF document to a Word file (DOCX format) using the
pdf2docx
library. - Steps:
- Select a PDF file to convert.
- Specify the output Word file name and location.
- The application processes the file and saves the Word document.
- Includes error handling for unsupported or corrupted PDF files.
- Convert Word documents (DOCX/DOC) into PDF format using the
docx2pdf
library. - Steps:
- Select a Word file to convert.
- Specify the output PDF file name and location.
- The application processes the file and saves the PDF.
- Supports a variety of Word document formats.
- Uses the
PyMuPDF
(fitz) library to render PDF pages with high clarity. - Pages are rendered at a high zoom factor (2.5x) for crisp and readable text.
- Automatically scales rendered pages according to the zoom level for consistent quality.
- Built using PyQt5 with a focus on ease of use and aesthetic design.
- Buttons and Controls Styling:
- Modern button styles with hover effects for better user experience.
- Adaptive Layouts:
- The main window automatically adjusts to the screen size and maximizes for optimal viewing.
- Click the Open PDF button.
- Select a PDF file from your system.
- The application will load the file and display the first page.
- Use navigation and zoom controls to view the document.
- Use the Previous Page and Next Page buttons to move one page at a time.
- Enter the desired page number in the spin box to jump to a specific page.
- Use the Zoom In or Zoom Out buttons to adjust the zoom level.
- Alternatively, use the Zoom Slider to set the zoom percentage directly.
- Click the Convert PDF to Word button.
- Select a PDF file and specify the output location for the Word document.
- Wait for the conversion to complete, and a success message will appear.
- Click the Convert Word to PDF button.
- Select a Word file and specify the output location for the PDF document.
- Wait for the conversion to complete, and a success message will appear.
-
Core Libraries Used:
PyQt5
: For the graphical user interface.fitz
(PyMuPDF): For rendering PDF pages and high-quality image generation.pdf2docx
: For converting PDFs to Word documents.docx2pdf
: For converting Word documents to PDF files.numpy
: For image data manipulation.
-
High-Performance Rendering:
- Renders pages using a zoom matrix (
fitz.Matrix
) to ensure sharpness and clarity. - Converts RGBA images to RGB for optimal display.
- Renders pages using a zoom matrix (
-
User-Friendly Controls:
- The interface is intuitive and minimizes user effort.
- Error messages are displayed for invalid inputs or unsupported file formats.
- Python 3.8 or later
- Required Python Libraries:
PyQt5
fitz
(PyMuPDF)pdf2docx
docx2pdf
numpy
- Install the required libraries using pip:
pip install PyQt5 fitz pdf2docx docx2pdf numpy
- Run the application:
python your_script_name.py