Skip to content

Tag: javascript

How to write javascript to reorder pages of a pdf document?

I have a double-sided document as two separate pdf files — front-facing pages in one document and rear-facing pages in the second. I have also combined them into a single document with all the pages but with all the front-facing pages before the rear-facing pages. The page ordering is of the form, {1,3,5,7,&#…

Javascript – sort array based on another array

Is it possible to sort and rearrange an array that looks like this: to match the arrangement of this array: Unfortunately, I don’t have any IDs to keep track on. I would need to priority the items-array to match the sortingArr as close as possible. Update: Here is the output I’m looking for: Any idea how this…