<?php
// Say we have a 74-page file
$num_pages = 74;
// Fill and array.
$pages = range(1, $num_pages);
$sections = array();
for ($i = 1; $i <= $pages; $i = $i+2) {
$next = $i+1;
$sections[] = "pdftk A=the.pdf cat A{$i}-{$next} output the_pages_{$i}-{$next}.pdf";
if ($i > 150) {
break;
}
}
print_r($sections);
- Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.21, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
- Array
(
[0] => pdftk A=the.pdf cat A1-2 output the_pages_1-2.pdf
[1] => pdftk A=the.pdf cat A3-4 output the_pages_3-4.pdf
[2] => pdftk A=the.pdf cat A5-6 output the_pages_5-6.pdf
[3] => pdftk A=the.pdf cat A7-8 output the_pages_7-8.pdf
[4] => pdftk A=the.pdf cat A9-10 output the_pages_9-10.pdf
[5] => pdftk A=the.pdf cat A11-12 output the_pages_11-12.pdf
[6] => pdftk A=the.pdf cat A13-14 output the_pages_13-14.pdf
[7] => pdftk A=the.pdf cat A15-16 output the_pages_15-16.pdf
[8] => pdftk A=the.pdf cat A17-18 output the_pages_17-18.pdf
[9] => pdftk A=the.pdf cat A19-20 output the_pages_19-20.pdf
[10] => pdftk A=the.pdf cat A21-22 output the_pages_21-22.pdf
[11] => pdftk A=the.pdf cat A23-24 output the_pages_23-24.pdf
[12] => pdftk A=the.pdf cat A25-26 output the_pages_25-26.pdf
[13] => pdftk A=the.pdf cat A27-28 output the_pages_27-28.pdf
[14] => pdftk A=the.pdf cat A29-30 output the_pages_29-30.pdf
[15] => pdftk A=the.pdf cat A31-32 output the_pages_31-32.pdf
[16] => pdftk A=the.pdf cat A33-34 output the_pages_33-34.pdf
[17] => pdftk A=the.pdf cat A35-36 output the_pages_35-36.pdf
[18] => pdftk A=the.pdf cat A37-38 output the_pages_37-38.pdf
[19] => pdftk A=the.pdf cat A39-40 output the_pages_39-40.pdf
[20] => pdftk A=the.pdf cat A41-42 output the_pages_41-42.pdf
[21] => pdftk A=the.pdf cat A43-44 output the_pages_43-44.pdf
[22] => pdftk A=the.pdf cat A45-46 output the_pages_45-46.pdf
[23] => pdftk A=the.pdf cat A47-48 output the_pages_47-48.pdf
[24] => pdftk A=the.pdf cat A49-50 output the_pages_49-50.pdf
[25] => pdftk A=the.pdf cat A51-52 output the_pages_51-52.pdf
[26] => pdftk A=the.pdf cat A53-54 output the_pages_53-54.pdf
[27] => pdftk A=the.pdf cat A55-56 output the_pages_55-56.pdf
[28] => pdftk A=the.pdf cat A57-58 output the_pages_57-58.pdf
[29] => pdftk A=the.pdf cat A59-60 output the_pages_59-60.pdf
[30] => pdftk A=the.pdf cat A61-62 output the_pages_61-62.pdf
[31] => pdftk A=the.pdf cat A63-64 output the_pages_63-64.pdf
[32] => pdftk A=the.pdf cat A65-66 output the_pages_65-66.pdf
[33] => pdftk A=the.pdf cat A67-68 output the_pages_67-68.pdf
[34] => pdftk A=the.pdf cat A69-70 output the_pages_69-70.pdf
[35] => pdftk A=the.pdf cat A71-72 output the_pages_71-72.pdf
[36] => pdftk A=the.pdf cat A73-74 output the_pages_73-74.pdf
[37] => pdftk A=the.pdf cat A75-76 output the_pages_75-76.pdf
[38] => pdftk A=the.pdf cat A77-78 output the_pages_77-78.pdf
[39] => pdftk A=the.pdf cat A79-80 output the_pages_79-80.pdf
[40] => pdftk A=the.pdf cat A81-82 output the_pages_81-82.pdf
[41] => pdftk A=the.pdf cat A83-84 output the_pages_83-84.pdf
[42] => pdftk A=the.pdf cat A85-86 output the_pages_85-86.pdf
[43] => pdftk A=the.pdf cat A87-88 output the_pages_87-88.pdf
[44] => pdftk A=the.pdf cat A89-90 output the_pages_89-90.pdf
[45] => pdftk A=the.pdf cat A91-92 output the_pages_91-92.pdf
[46] => pdftk A=the.pdf cat A93-94 output the_pages_93-94.pdf
[47] => pdftk A=the.pdf cat A95-96 output the_pages_95-96.pdf
[48] => pdftk A=the.pdf cat A97-98 output the_pages_97-98.pdf
[49] => pdftk A=the.pdf cat A99-100 output the_pages_99-100.pdf
[50] => pdftk A=the.pdf cat A101-102 output the_pages_101-102.pdf
[51] => pdftk A=the.pdf cat A103-104 output the_pages_103-104.pdf
[52] => pdftk A=the.pdf cat A105-106 output the_pages_105-106.pdf
[53] => pdftk A=the.pdf cat A107-108 output the_pages_107-108.pdf
[54] => pdftk A=the.pdf cat A109-110 output the_pages_109-110.pdf
[55] => pdftk A=the.pdf cat A111-112 output the_pages_111-112.pdf
[56] => pdftk A=the.pdf cat A113-114 output the_pages_113-114.pdf
[57] => pdftk A=the.pdf cat A115-116 output the_pages_115-116.pdf
[58] => pdftk A=the.pdf cat A117-118 output the_pages_117-118.pdf
[59] => pdftk A=the.pdf cat A119-120 output the_pages_119-120.pdf
[60] => pdftk A=the.pdf cat A121-122 output the_pages_121-122.pdf
[61] => pdftk A=the.pdf cat A123-124 output the_pages_123-124.pdf
[62] => pdftk A=the.pdf cat A125-126 output the_pages_125-126.pdf
[63] => pdftk A=the.pdf cat A127-128 output the_pages_127-128.pdf
[64] => pdftk A=the.pdf cat A129-130 output the_pages_129-130.pdf
[65] => pdftk A=the.pdf cat A131-132 output the_pages_131-132.pdf
[66] => pdftk A=the.pdf cat A133-134 output the_pages_133-134.pdf
[67] => pdftk A=the.pdf cat A135-136 output the_pages_135-136.pdf
[68] => pdftk A=the.pdf cat A137-138 output the_pages_137-138.pdf
[69] => pdftk A=the.pdf cat A139-140 output the_pages_139-140.pdf
[70] => pdftk A=the.pdf cat A141-142 output the_pages_141-142.pdf
[71] => pdftk A=the.pdf cat A143-144 output the_pages_143-144.pdf
[72] => pdftk A=the.pdf cat A145-146 output the_pages_145-146.pdf
[73] => pdftk A=the.pdf cat A147-148 output the_pages_147-148.pdf
[74] => pdftk A=the.pdf cat A149-150 output the_pages_149-150.pdf
[75] => pdftk A=the.pdf cat A151-152 output the_pages_151-152.pdf
)
- Output for 8.3.5
- Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Array
(
[0] => pdftk A=the.pdf cat A1-2 output the_pages_1-2.pdf
[1] => pdftk A=the.pdf cat A3-4 output the_pages_3-4.pdf
[2] => pdftk A=the.pdf cat A5-6 output the_pages_5-6.pdf
[3] => pdftk A=the.pdf cat A7-8 output the_pages_7-8.pdf
[4] => pdftk A=the.pdf cat A9-10 output the_pages_9-10.pdf
[5] => pdftk A=the.pdf cat A11-12 output the_pages_11-12.pdf
[6] => pdftk A=the.pdf cat A13-14 output the_pages_13-14.pdf
[7] => pdftk A=the.pdf cat A15-16 output the_pages_15-16.pdf
[8] => pdftk A=the.pdf cat A17-18 output the_pages_17-18.pdf
[9] => pdftk A=the.pdf cat A19-20 output the_pages_19-20.pdf
[10] => pdftk A=the.pdf cat A21-22 output the_pages_21-22.pdf
[11] => pdftk A=the.pdf cat A23-24 output the_pages_23-24.pdf
[12] => pdftk A=the.pdf cat A25-26 output the_pages_25-26.pdf
[13] => pdftk A=the.pdf cat A27-28 output the_pages_27-28.pdf
[14] => pdftk A=the.pdf cat A29-30 output the_pages_29-30.pdf
[15] => pdftk A=the.pdf cat A31-32 output the_pages_31-32.pdf
[16] => pdftk A=the.pdf cat A33-34 output the_pages_33-34.pdf
[17] => pdftk A=the.pdf cat A35-36 output the_pages_35-36.pdf
[18] => pdftk A=the.pdf cat A37-38 output the_pages_37-38.pdf
[19] => pdftk A=the.pdf cat A39-40 output the_pages_39-40.pdf
[20] => pdftk A=the.pdf cat A41-42 output the_pages_41-42.pdf
[21] => pdftk A=the.pdf cat A43-44 output the_pages_43-44.pdf
[22] => pdftk A=the.pdf cat A45-46 output the_pages_45-46.pdf
[23] => pdftk A=the.pdf cat A47-48 output the_pages_47-48.pdf
[24] => pdftk A=the.pdf cat A49-50 output the_pages_49-50.pdf
[25] => pdftk A=the.pdf cat A51-52 output the_pages_51-52.pdf
[26] => pdftk A=the.pdf cat A53-54 output the_pages_53-54.pdf
[27] => pdftk A=the.pdf cat A55-56 output the_pages_55-56.pdf
[28] => pdftk A=the.pdf cat A57-58 output the_pages_57-58.pdf
[29] => pdftk A=the.pdf cat A59-60 output the_pages_59-60.pdf
[30] => pdftk A=the.pdf cat A61-62 output the_pages_61-62.pdf
[31] => pdftk A=the.pdf cat A63-64 output the_pages_63-64.pdf
[32] => pdftk A=the.pdf cat A65-66 output the_pages_65-66.pdf
[33] => pdftk A=the.pdf cat A67-68 output the_pages_67-68.pdf
[34] => pdftk A=the.pdf cat A69-70 output the_pages_69-70.pdf
[35] => pdftk A=the.pdf cat A71-72 output the_pages_71-72.pdf
[36] => pdftk A=the.pdf cat A73-74 output the_pages_73-74.pdf
[37] => pdftk A=the.pdf cat A75-76 output the_pages_75-76.pdf
[38] => pdftk A=the.pdf cat A77-78 output the_pages_77-78.pdf
[39] => pdftk A=the.pdf cat A79-80 output the_pages_79-80.pdf
[40] => pdftk A=the.pdf cat A81-82 output the_pages_81-82.pdf
[41] => pdftk A=the.pdf cat A83-84 output the_pages_83-84.pdf
[42] => pdftk A=the.pdf cat A85-86 output the_pages_85-86.pdf
[43] => pdftk A=the.pdf cat A87-88 output the_pages_87-88.pdf
[44] => pdftk A=the.pdf cat A89-90 output the_pages_89-90.pdf
[45] => pdftk A=the.pdf cat A91-92 output the_pages_91-92.pdf
[46] => pdftk A=the.pdf cat A93-94 output the_pages_93-94.pdf
[47] => pdftk A=the.pdf cat A95-96 output the_pages_95-96.pdf
[48] => pdftk A=the.pdf cat A97-98 output the_pages_97-98.pdf
[49] => pdftk A=the.pdf cat A99-100 output the_pages_99-100.pdf
[50] => pdftk A=the.pdf cat A101-102 output the_pages_101-102.pdf
[51] => pdftk A=the.pdf cat A103-104 output the_pages_103-104.pdf
[52] => pdftk A=the.pdf cat A105-106 output the_pages_105-106.pdf
[53] => pdftk A=the.pdf cat A107-108 output the_pages_107-108.pdf
[54] => pdftk A=the.pdf cat A109-110 output the_pages_109-110.pdf
[55] => pdftk A=the.pdf cat A111-112 output the_pages_111-112.pdf
[56] => pdftk A=the.pdf cat A113-114 output the_pages_113-114.pdf
[57] => pdftk A=the.pdf cat A115-116 output the_pages_115-116.pdf
[58] => pdftk A=the.pdf cat A117-118 output the_pages_117-118.pdf
[59] => pdftk A=the.pdf cat A119-120 output the_pages_119-120.pdf
[60] => pdftk A=the.pdf cat A121-122 output the_pages_121-122.pdf
[61] => pdftk A=the.pdf cat A123-124 output the_pages_123-124.pdf
[62] => pdftk A=the.pdf cat A125-126 output the_pages_125-126.pdf
[63] => pdftk A=the.pdf cat A127-128 output the_pages_127-128.pdf
[64] => pdftk A=the.pdf cat A129-130 output the_pages_129-130.pdf
[65] => pdftk A=the.pdf cat A131-132 output the_pages_131-132.pdf
[66] => pdftk A=the.pdf cat A133-134 output the_pages_133-134.pdf
[67] => pdftk A=the.pdf cat A135-136 output the_pages_135-136.pdf
[68] => pdftk A=the.pdf cat A137-138 output the_pages_137-138.pdf
[69] => pdftk A=the.pdf cat A139-140 output the_pages_139-140.pdf
[70] => pdftk A=the.pdf cat A141-142 output the_pages_141-142.pdf
[71] => pdftk A=the.pdf cat A143-144 output the_pages_143-144.pdf
[72] => pdftk A=the.pdf cat A145-146 output the_pages_145-146.pdf
[73] => pdftk A=the.pdf cat A147-148 output the_pages_147-148.pdf
[74] => pdftk A=the.pdf cat A149-150 output the_pages_149-150.pdf
[75] => pdftk A=the.pdf cat A151-152 output the_pages_151-152.pdf
)
preferences:
154.46 ms | 413 KiB | 204 Q