I went through the documentation and source code. It seems we can't do page rotation right now. Is my understanding correct?
Hello @qingxiang-jia!
Page rotation is not currently documented, but it is certainly possible to do. It's quite straightforward:
import { PDFNumber } from 'pdf-lib';
const pdfDoc = ...
const firstPage = pdfDoc.getPages()[0];
// Rotate the first page by 180 degrees
firstPage.set('Rotate', PDFNumber.fromNumber(180));
Please let me know if you have any further questions!
Thank you for the help. That's great to know!
Most helpful comment
Hello @qingxiang-jia!
Page rotation is not currently documented, but it is certainly possible to do. It's quite straightforward:
Please let me know if you have any further questions!