Split PDF with GS and a little addon
Hello together
Please i have here a little toy to learn and for "possible" usage.
the goal are that i need to split me pdf document to single sides.
with the Appl GS, i can this do without problem, but i need to edit
any time my batch script. here i was thinking with this little app
that i have here i can do any workaround, and ask how meny pages you have, and this will do automatic this split.
Please are this a possible realistic way??
thanks meny time for your possible help
regards and thanks
Mauri
Code:
#include <stdio.h>
#include <process.h>
int main()
{
int choice=0;
printf("\n******* this App will split your PDF in single PDF Sites **********\n");
printf("1. how meny pages have your PDF 1\n");
printf("2. how meny pages have your PDF 2\n");
printf("3. how meny pages have your PDF 3\n");
printf("4. how meny pages have your PDF 4\n");
printf("5. how meny pages have your PDF 5\n");
printf("6. how meny pages have your PDF 6\n");
printf("7. how meny pages have your PDF 7\n");
printf("** Enter your choice :");
scanf("%d",&choice);
switch(choice)
{
case 1:
system("C:\Program Files\gs\gs9.53.3\bin\gswin64.exe -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=1 -sOutputFile=%%d.pdf combine.pdf");
break;
case 2:
system("C:\Program Files\gs\gs9.53.3\bin\gswin64.exe -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=2 -dLastPage=2 -sOutputFile=%%d.pdf combine.pdf");
break;
case 3:
system("C:\Program Files\gs\gs9.53.3\bin\gswin64.exe -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=3 -sOutputFile=%%d.pdf combine.pdf");
break;
case 4:
system("C:\Program Files\gs\gs9.53.3\bin\gswin64.exe -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=4 -sOutputFile=%%d.pdf combine.pdf");
break;
case 5:
system("C:\Program Files\gs\gs9.53.3\bin\gswin64.exe -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=5 -sOutputFile=%%d.pdf combine.pdf");
break;
case 6:
system("C:\Program Files\gs\gs9.53.3\bin\gswin64.exe -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=6 -sOutputFile=%%d.pdf combine.pdf");
break;
case 7:
system("C:\Program Files\gs\gs9.53.3\bin\gswin64.exe -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=7 -sOutputFile=%%d.pdf combine.pdf");
break;
default:
printf("\n Invalid choice !!!");
}
return 0;
}