JSFiddle - React, Tailwind, and code Playground

by stofke

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.min.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PDF Table and Text Extractor</title>
    <style>
        body { 
            font-family: Arial, sans-serif; 
            margin: 0;
            padding: 20px;
            background-color: #f7f7f7;
        }
        h1, h2 {
            color: #333;
        }
        #textContainer, #instructionsContainer {
            margin-bottom: 20px;
            padding: 15px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        table {
            border-collapse: collapse; 
            width: 100%;
            margin-top: 20px;
            background-color: #fff;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
            overflow: hidden;
        }
        th, td { 
            border: 1px solid #ddd; 
            text-align: left; 
            padding: 12px; 
        }
        th {
            background-color: #4CAF50;
            color: white;
        }
        td {
            background-color: #f9f9f9;
        }
        tr:nth-child(even) { background-color: #f2f2f2; }
    </style>
</head>
<body>
    <h1>Persimmon Availability List 2024-2025</h1>
    
    <h2>Instructions</h2>
    <div id="instructionsContainer">Loading instructions...</div>
    
    <h2>Content</h2>
    <div id="textContainer">Loading content...</div>
    <div id="tableContainer"></div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.min.js"></script>
    <script>
        // Specify the workerSrc for PDF.js
        pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.worker.min.js';

        // Using CORS proxy for Google Drive links (for testing)
        const...

JavaScript

pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.10.377/pdf.worker.min.js';

const pdfPersimmonUrl = 'https://cors-anywhere.herokuapp.com/https://drive.google.com/uc?export=download&id=1moviyNkmlo3_EaspCsYmIzKZChytk1Gj';
const pdfInstructionsUrl = 'https://cors-anywhere.herokuapp.com/https://drive.google.com/uc?export=download&id=1sIwZ01pAEiJgtPqhMjMlY6H8wxQvM80b';