Hi wsrhere's the issue:We needed to pass some physical documents to digital PDF files, some other department did that, but the thing is... they scanned everything in inverse order, like the first page showing the one which should be shown at last and such, is there any way to automatically make every pdf file pages be rearranged in inverse order?I mean, I saw there were some pages which did this, but it requires to upload every file, and it's around 50k files, so I wonder if there's some script or something which may help me to do so. Pic unrelated.
>>1541735https://unix.stackexchange.com/questions/439959/how-to-reverse-the-page-order-of-a-pdf-filefirst suggestion recommends: pdftk myfile.pdf cat end-1 output myfilereversed.pdfThen if you want to do it for multiple files, just in the directory with files create directory "reversed" and run something like:for f in *.pdf; do pdftk $f cat end-1 output reversed/$f ; donethat should work on linux or mac, if you use windows it should be more or less similar, just ask chatgpt to tell you how to do same with cmd or powershell
>>1541744thanks, going to check that out at the office tomorrow.I guess I'll have to try it with cmd or powershell because we use windows there.
I suggest testing your script with spare copies of some of the pdfs to ensure your command doesn't modify/delete your source pdfs (lest you lose your only copies of a scan).(An alternative to pdftk is qpdf. Though I suppose pdftk has cleaner syntax.The command to reverse one pdf is qpdf --empty --pages file.pdf z-1 -- output.pdf)
>>1541822>>1541744tested with the pdftk, installed the free version, the program asked to pay for use, but I could use it with a command line like the first answer said, I was preppared to get the filenames on some script to automatically sort them, but then they said they didn't do it backwards, but in complete disorder, and it wasn't actually that many files, just like 20 files with around 500 pages each (they gave me wrong info or exagerated "a bit" for whatever reason), so they opted to manually sort them with adobe (they have a licence for that), thank you all for your help anyways, at least I learnt how to do that.
>>1541872>have to manually sort 20x500 pagesgrim. Hopefully they're numbered