cleaned up node server

This commit is contained in:
Saud Fatayerji
2023-10-26 21:53:02 +03:00
parent 02f98fb378
commit 13c4f664c2
24 changed files with 181 additions and 1261 deletions

View File

@@ -1,3 +1,6 @@
import PDFLib from 'pdf-lib';
/**
* @typedef {Object} Metadata
* @property {string | null | undefined} Title - The title of the document.
@@ -14,10 +17,10 @@
*
* @param {Uint16Array} snapshot
* @param {Metadata} metadata - Set property to null or "" to clear, undefined properties will be skipped.
* @param {import('pdf-lib')} PDFLib
* @param {PDFLib} PDFLib
* @returns
*/
export async function editMetadata(snapshot, metadata, PDFLib) {
export async function editMetadata(snapshot, metadata) {
// Load the original PDF file
const pdfDoc = await PDFLib.PDFDocument.load(snapshot, {
parseSpeed: PDFLib.ParseSpeeds.Fastest,