I am making a website that can modify pdf files , and I was trying to be able to rotate a page or multiple pages but couldn't find how to do that in their docs .
const pdfDoc = await loadSingleFile(inputFiles[0]) // An input pdf file
const rotatedPdf = await PDFDocument.create(); // Intitialize the rotated pdf file
const pageToRotate = pdfDoc.getPages()[pageIndex]
// Not sure what to write here
const pdfDataString = await rotatedPdf.saveAsBase64({ dataUri: true }); // here generate string for further use