Arrange this type for 90 page
| Col 1 | Col 2 | Col 3 |
|---|---|---|
| 1 | 3 | 5 |
| 7 | 9 | 11 |
| 13 | 15 | 17 |
| 19 | 21 | 23 |
| 25 | 27 | 29 |
| 31 | 33 | 35 |
| 37 | 39 | 41 |
| 43 | 45 | 47 |
| 49 | 51 | 53 |
| 55 | 57 | 59 |
| 61 | 63 | 65 |
| 67 | 69 | 71 |
| 73 | 75 | 77 |
| 79 | 81 | 83 |
| 85 | 87 | 89 |
| Col 1 | Col 2 | Col 3 |
|---|---|---|
| 6 | 4 | 2 |
| 12 | 10 | 8 |
| 18 | 16 | 14 |
| 24 | 22 | 20 |
| 30 | 28 | 26 |
| 36 | 34 | 32 |
| 42 | 40 | 38 |
| 48 | 46 | 44 |
| 54 | 52 | 50 |
| 60 | 58 | 56 |
| 66 | 64 | 62 |
| 72 | 70 | 68 |
| 78 | 76 | 74 |
| 84 | 82 | 80 |
| 90 | 88 | 86 |
Arrange this pdf in this manner but only for 54 pages
| Col 1 | Col 2 | Col 3 |
|---|---|---|
| 1 | 3 | 5 |
| 7 | 9 | 11 |
| 13 | 15 | 17 |
| 19 | 21 | 23 |
| 25 | 27 | 29 |
| 31 | 33 | 35 |
| 37 | 39 | 41 |
| 43 | 45 | 47 |
| 49 | 51 | 53 |
| Col 1 | Col 2 | Col 3 |
|---|---|---|
| 6 | 4 | 2 |
| 12 | 10 | 8 |
| 18 | 16 | 14 |
| 24 | 22 | 20 |
| 30 | 28 | 26 |
| 36 | 34 | 32 |
| 42 | 40 | 38 |
| 48 | 46 | 44 |
| 54 | 52 | 50 |
Aarange pages only
python3 << 'EOF' from pypdf import PdfReader, PdfWriter input_path = "/tmp/workspace/attachments/8ba49562-16cc-4f5a-8e31-759aef90f381/anat ii paper final print.pdf" output_path = "/tmp/workspace/anat_ii_rearranged.pdf" reader = PdfReader(input_path) total_pages = len(reader.pages) print(f"Total pages in PDF: {total_pages}") # Build the page order (1-indexed page numbers from the notebook pattern) # Part 1: Odd pages in order: 1, 3, 5, ..., 53 odd_pages = list(range(1, 54, 2)) # [1,3,5,...,53] # Part 2: Even pages right-to-left in groups of 3: # Row 1: 6,4,2 # Row 2: 12,10,8 # ... # Row 9: 54,52,50 even_pages = [] for group in range(1, 10): # groups 1-9 high = group * 6 mid = high - 2 low = high - 4 even_pages.extend([high, mid, low]) print(f"Odd pages ({len(odd_pages)}): {odd_pages}") print(f"Even pages ({len(even_pages)}): {even_pages}") full_order = odd_pages + even_pages print(f"\nFull page order ({len(full_order)} pages): {full_order}") # Write rearranged PDF (convert 1-indexed to 0-indexed) writer = PdfWriter() for page_num in full_order: idx = page_num - 1 if idx < total_pages: writer.add_page(reader.pages[idx]) else: print(f"WARNING: Page {page_num} does not exist (PDF only has {total_pages} pages)") with open(output_path, "wb") as f: writer.write(f) print(f"\nDone! Saved to: {output_path}") EOF
anat ii rearranged
PDF Document · PDF
| Section | Pages |
|---|---|
| Odd (27 pages) | 1, 3, 5, 7, 9, 11 ... 49, 51, 53 |
| Even right→left (27 pages) | 6,4,2 / 12,10,8 / 18,16,14 / 24,22,20 / 30,28,26 / 36,34,32 / 42,40,38 / 48,46,44 / 54,52,50 |