Frequently Asked Question:
How do I arrange pages after extracting them with the ExtractFilePages function?
How do I arrange pages after extracting them with the ExtractFilePages function?
There isn't a parameter that can be used with the ExtractFilePages function to arrange pages after they have been extracted -- instead the extracted pages in a new document are arranged in ascending order -- but there is a relatively simple workaround for arranging pages that can be used after the pages have been extracted. The workaround is desribed here:
- Do multiple extractions for each page group where the page sequence is not in order to a temporary file [x]
- Do a complete extraction for series of page groups where they are in sequence, [x+1].
- Perform a merge of all temporary pages files to output file.
- Deletes all temporary files.
Example: Customer enters, RangeList of "2,1, 3-5, 5,6,7] with output file "outputfile.pdf"
Extract page 2 -> tempfile01.pdf | AddToMergeList "workaround"
Extract page 1 -> tempfile02.pdf | AddToMergeList "workaround"
Extract pages 3-5 -> tempfile03.pdf | AddToMergeList "workaround"
Extract page -> 7 -> tempfile04.pdf | AddToMergeList "workaround"
MergeFileList "workdaround", "outputfile.pdf"
Delete tempfile*.pdf