- Corretta query di estrapolazione libri su GM (Marco)

- aggiornato bestseller su fatlast1Y
- non mostrare piu i libri che non hanno l'immagine (sul catalogo).
- metti online i compressi
This commit is contained in:
Surya Paolo
2025-06-16 19:36:57 +02:00
parent 5668c620da
commit 8c0619992b
9 changed files with 117 additions and 58 deletions

View File

@@ -635,6 +635,8 @@ async function JoinPDFCatalogs(cataloghi, options, outputFile, stampa) {
const pdfDoc = await PDFDocument.create();
let numcat = 0;
for (let id_catalog of cataloghi) {
let catalog = await Catalog.findOne({ _id: id_catalog });
if (catalog) {
@@ -642,6 +644,11 @@ async function JoinPDFCatalogs(cataloghi, options, outputFile, stampa) {
if (filename) {
let myfile = tools.fixFilePath(options.mydir + '/' + filename);
if (await tools.isFileExistsAsync(myfile)) {
const filenameOnly = path.parse(myfile).base;
numcat++;
console.log(' Aggiungo il catalogo [' + numcat + '] ' + filenameOnly + ' ...');
const pdfBytes = await fs.promises.readFile(myfile);
const pdf = await PDFDocument.load(pdfBytes);
const pages = pdf.getPages();