Author Topic: Would like to develop a combined script for various needs.  (Read 5366 times)

0 Members and 1 Guest are viewing this topic.

nightslayer23

  • Newbie
  • *
  • Posts: 98
Would like to develop a combined script for various needs.
« on: March 23, 2021, 01:50:14 AM »
Hi again. We are requesting a script that does the following steps in sequence...

1. Automatically adds a pdf from source file to the end of the pdf.
2. Uses the logic and context window of the multi combine tool (merge various copies custom script - attached)
3. But also on the Query Dialogue window, it has a box that requests a number to make the combine file a multiple of, "Make a multiple of:"
4. Also rotates Odd pages Clockwise, Even pages Counter-Clockwise.
5. Save output As:


RTT

  • Administrator
  • *****
  • Posts: 918
Re: Would like to develop a combined script for various needs.
« Reply #1 on: March 24, 2021, 02:26:06 AM »
No sure about the 1st step, but check if the attached script is what you need.
If not correct, please give me more details.

nightslayer23

  • Newbie
  • *
  • Posts: 98
Re: Would like to develop a combined script for various needs.
« Reply #2 on: March 24, 2021, 02:51:22 AM »
No sure about the 1st step, but check if the attached script is what you need.
If not correct, please give me more details.

yes this almost worked perfectly!

except we need the "copies of" to come first prior to making it a multiple of.

and step one is basically just the insert/append function, adding a specified page to the end of the file before making any changes. so that page also repeats on the "copies of" function. this insert pdf to be selected from explorer or "recently used"

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Would like to develop a combined script for various needs.
« Reply #3 on: March 24, 2021, 05:09:08 PM »
Starting with 2 PDFs, each with 3 pages, the above script (except for a bug in the even odd page rotation logic), will create the next sequence of pages for 2 merged copies of each document, and the "multiple of" set to 3.

PDF1P1R90
PDF1P2R-90
PDF1P3R90
PDF1P1R90
PDF1P2R-90
PDF1P3R90
PDF2P1R90
PDF2P2R-90
PDF2P3R90
PDF2P1R90
PDF2P2R-90
PDF2P3R90

PDF1P1R90
PDF1P2R-90
PDF1P3R90
PDF1P1R90
PDF1P2R-90
PDF1P3R90
PDF2P1R90
PDF2P2R-90
PDF2P3R90
PDF2P1R90
PDF2P2R-90
PDF2P3R90

PDF1P1R90
PDF1P2R-90
PDF1P3R90
PDF1P1R90
PDF1P2R-90
PDF1P3R90
PDF2P1R90
PDF2P2R-90
PDF2P3R90
PDF2P1R90
PDF2P2R-90
PDF2P3R90

Using this notation (and/or with different number of documents, pages and number of copies), give me a similar example of the sequence you need.

Also, is there a need for the documents to have an even number of pages or a odd number also works?

nightslayer23

  • Newbie
  • *
  • Posts: 98
Re: Would like to develop a combined script for various needs.
« Reply #4 on: March 25, 2021, 12:54:14 AM »
It would usually be only the one file.

File is:

Original File:
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
(pages 8 ).pdf

Step 1: Add divider pdf:
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
>>> Insert Divider Page (selected from file)<<< [two pages to account for front & back ie: odd and even]

Result:
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
PDFFRONT
PDFBACK
NEW_PDFFRONT
NEW_PDFBACK

(pages 10).pdf

Step 2: Duplicate the run [ x ] copies: x = 20

(pages 10).pdfx20 = (pages 200).pdf

Step 3: make a multiple of [n] : n=18

(pages 200).pdf > multiple of 18 > (pages 216).pdf [16 blanks added]

Step 4: Rotate odd [fronts] clockwise & even [back] counterclockwise:

PDFFRONT 90
PDFBACK -90 .....
.... PDFFRONT 90
PDFBACK -90
PDFFRONT 90
PDFBACK -90
PDFFRONT 90
PDFBACK -90
PDFFRONT 90
PDFBACK -90
NEW_PDFFRONT 90
NEW_PDFBACK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90
BLANK 90
BLANK -90

Result: (218 pages).pdf (alternating rotate)

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Would like to develop a combined script for various needs.
« Reply #5 on: March 26, 2021, 05:58:39 PM »
Check the attached one.
Run it against the original file. It will prompt for the divider PDF, with a open file dialog, and query for the number of copies and the multiple of value with a query dialog. When done it will ask were to save the result PDF.

nightslayer23

  • Newbie
  • *
  • Posts: 98
Re: Would like to develop a combined script for various needs.
« Reply #6 on: March 29, 2021, 03:08:37 AM »
Wonderful work  ;D will let you know if we run into any bugs ! thankyou thankyou

nightslayer23

  • Newbie
  • *
  • Posts: 98
Re: Would like to develop a combined script for various needs.
« Reply #7 on: March 29, 2021, 03:55:31 AM »
having an issue with the rotating.. when the page count gets too large, it seems to be timing out on the rotating and only does a portion of the pages

RTT

  • Administrator
  • *****
  • Posts: 918
Re: Would like to develop a combined script for various needs.
« Reply #8 on: March 29, 2021, 04:36:42 PM »
Bug in the API. I've updated the above script with a workaround.

If the original, and divider, PDFs number of pages is always multiple of two, there is the possibility to set the pages rotation in the 1st step, and that would speed up the operation.

nightslayer23

  • Newbie
  • *
  • Posts: 98
Re: Would like to develop a combined script for various needs.
« Reply #9 on: March 30, 2021, 02:33:49 AM »
that DID significantly improve the rotating! wow. and now the script work to its full functionality! thankyou.