Make New PDF417 Barcode

PDF417 Data Collection Form

目前為 2024-11-02 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Make New PDF417 Barcode
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  PDF417 Data Collection Form
// @license     MIT
// @match        *://*/*
// @author      SijosxStudio
// @url             https://tinyurl.com/BuySijosxStudioCoffee
// @grant        none

// ==/UserScript==

(function() {
    'use strict';

    // Create the form HTML
    const formHTML = `<!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>PDF417 Data Collection</title>
        <style>
            body {
                font-family: Arial, sans-serif;
            }
            form {
                max-width: 600px;
                margin: 0 auto;
                padding: 20px;
                border: 1px solid #ccc;
                border-radius: 5px;
                background-color: #f9f9f9;
            }
            label {
                display: block;
                margin-bottom: 10px;
            }
            input[type="text"] {
                width: 100%;
                padding: 8px;
                margin-bottom: 15px;
                border: 1px solid #ccc;
                border-radius: 4px;
            }
            button {
                padding: 10px 15px;
                background-color: #28a745;
                color: white;
                border: none;
                border-radius: 5px;
                cursor: pointer;
            }
            button:hover {
                background-color: #218838;
            }
        </style>
    </head>
    <body>

    <h1>PDF417 Data Entry</h1>
    <form id="pdf417Form">
        <label for="dlNumber">Enter DL#: (DAQ)</label>
        <input type="text" id="dlNumber" required>

        <!-- Add all the other input fields here -->
        <label for="familyName">Enter Family Name (DCS):</label>
        <input type="text" id="familyName" required>
        
        <!-- Other fields truncated for brevity -->

        <button type="submit">Generate PDF417 Data</button>
    </form>

    <pre id="output"></pre>

    <script>
        document.getElementById('pdf417Form').addEventListener('submit', function(event) {
            event.preventDefault(); // Prevent form submission

            // Collect data from form fields
            const data = [];
            data.push(\`@LFRSCR\`); // Compliance indicator
            data.push(\`ANSI 636000100002\`); // File type, IIN, etc.
            const dlNumber = document.getElementById('dlNumber').value;
            data.push(\`DL\${dlNumber}LF\`); // DAQ

            data.push(\`DCS\${document.getElementById('familyName').value}LF\`);
            data.push(\`DDE\${document.getElementById('familyNameTruncation').value}LF\`);

            // Display the output data
            document.getElementById('output').textContent = data.join("\\n");
        });
    </script>
    </body>
    </html>`;

    // Inject the form HTML into the page
    document.body.innerHTML = formHTML;
})();