consolidated pdf generation for moodle collage ppts

you can manually download the files by clicking through each file, or do the following

  1. go to course page, inspect page, go to console and run below
document.querySelectorAll("a.aalink.stretched-link")
  1. find the count of id the the session materials start... and change slice_from to that number
slice_from= 12
Array.from(document.querySelectorAll("a.aalink.stretched-link")).slice(slice_from).forEach((link, i) => {
  setTimeout(() => {
    link.click();
  }, i * 1000); 
});

Step 2: organize the files

  1. move all the downloaded files to a dedicated folder (i use yazi-rs to do this)

Step 3: convert to pdfs

  1. use libreoffice cli to convert files to pdfs
libreoffice --convert-to pdf *.ppt*
  1. move pdf files to a new folder
mkdir pdfs
mv *.pdf pdfs/
cd pdfs/

Step 4: pdfunite

  1. usepdfunite to combine all pdfs
pdfunite "CS1.pdf" "CS2.pdf" "CS3.pdf" "CS4.pdf" "CS5.pdf" "CS6.pdf" "CS7.pdf" "CS9.pdf" "CS10.pdf" "CS11.pdf" "CS12.pdf" "CS13,1415.pdf" statistical-inference-and-applications-consolidated-ppts.pdf

Optional operations

OCR enabled PDFs for searching text

ocrmypdf input.pdf --force-ocr output.pdf

Tiled PDFs for printing

pdfjam --landscape --nup 3x3 --paper a4paper --outfile software-design-principals-consolidated-3x3-landscape.pdf ./software-design-principals-consolidated.pdf
# pdfjam --nup 3x3 --paper a4paper --angle 90 --outfile output.pdf computing-and-design-ppts-consolidated.pdf

crop and zoom in

 pdfjam --trim '5mm 15mm 5mm 15mm' --clip true --landscape --nup 3x3 --paper a4paper --outfile software-design-principals-consolidated-3x3-landscape.pdf ./software-design-principals-consolidated.pdf

Page number

pdfcpu stamp add -m text -- "%p" "pos:br, scale:0.02, rot:0" statistical-inference-and-applications-consolidated-3x3-landscape.pdf output.pdf

rough tests

pdfcpu stamp add -m text -- "Page %p of %P" "pos:br, scale:0.4, rot:0" database-design-ppts-consolidate.pdf output.pdf
pdfcpu stamp add -m text -- "%p" "pos:br, scale:0.4, rot:0" database-design-ppts-consolidate.pdf output.pdf      
pdfcpu nup -- "formsize:A4, orientation:rd" out9.pdf 9 database-design-ppts-consolidate.pdf