Question: A friend of mine gave me external hard drive and he deleted some personal files (using his computer) before he gave it to me. Few days after I plugged the HD in my PC, I saw several deleted files in my recycle bin (my PC) which originate from the HD. Thinking I accidentally deleted the files, I restored the files from my recycle bin. Can files deleted using other PC show in recycle bin of another PC? And yes, the restored files are actually timestamped at the time I restored from my PC. I am using Windows 10.
Thank you,
Amanuel

Answer: 
You might check out [QPDF](https://qpdf.readthedocs.io/en/stable/index.html) which is an open source tool to manipulate PDF files. With it you can split the file into pages, isolate particular pages, and then recombine those pages before sending the separate files to a specific printer. Or you can isolate pages based on particular properties (for example if they contain images), or by file or page length etc. It can also generate a JSON representation of the file characteristics so that you could build an algorithm to split the file based upon those characteristics using another program.

The tool can run on windows or linux machines.

In response to the comment from @MrUpsidown to my suggestion, I provide here an example shell script that takes an inputfile, and splits it up temporarily only to assess the size in bytes of each page. The split up pages are then used to create page lists of "special pages" that are big, and "regular pages" that are small, and then to create the cups lpr commands to send those pages to a printer. The script could be modified to examine each page for a text string (using e.g. pdftotext), or some other unique attribute. Anyway, one list is sent to tray Upper and the other to tray Lower. Then it cleans up after itself. The script will need tweaking to satisfy your needs, and be hardened for production use, but I think it should outline the basic method I was suggesting.

After installing qpdf on a linux machine (or mac) You run the script by creating a file (lets call it "splitpages"), then make it executable via `chmod 755`, then executing the script by invoking `splitpages filename.pdf`. It will currently just print out the commands that could be activated by replacing the "echo" with "eval" in the script. An example of executing the script like this
`splitpages samplefile.pdf`
where samplefile.pdf has 4 pages (3 normal, and the fourth special) would be for it to print out these strings

```
lpr -o media=Upper -o page-ranges=1,2,3, samplefile.pdf
lpr -o media=Lower -o page-ranges=4, samplefile.pdf

```

Of course other things need to be tweaked to suite your needs

```
#!/bin/bash
# print pages based on page size 
# greater than minimumsize goes to tray1
# else goes to tray2
minimumsize=500000
infile=$1
if [ ! -f "$infile" ]; then
    echo "no input file"
    exit
fi

# location of temporary files used to identify page characteristics
outfile=/tmp/test
rm -f ${outfile}*

# split the file so we can assess lengths
qpdf $infile --split-pages $outfile

pnum=0
bigpage=
smallpage=
for page in ${outfile}*
do
    ((pnum++))
    actualsize=$(wc -c <"$page")
    if [ $actualsize -ge $minimumsize ]; then
    #echo size is over $minimumsize bytes
    bigpage="${bigpage}${pnum},"
    else
    #echo size is under $minimumsize bytes
    smallpage="${smallpage}${pnum},"
    fi
done

# replace the echo command with the eval command to actually execute the strings
lprc1="lpr -o media=Upper -o page-ranges=$bigpage $infile"
echo $lprc1
lprc2="lpr -o media=Lower -o page-ranges=$smallpage $infile"
echo $lprc2
rm -f ${outfile}*

```
Adobe Acrobat Pro along with the
[AutoSplit Pro plug-in](https://evermap.com/AutoSplit.asp)
($149)
can do it. More information to be found in the article
[Extract Pages from a PDF Document Using a Text Search](https://evermap.com/Tutorial_ASP_ExtractPagesByTextSearch.asp).

[![enter image description here](https://i.stack.imgur.com/KoE8U.png)](https://i.stack.imgur.com/KoE8U.png)

You could also automate this yourself using document-level JavaScript
installed in one of Acrobat’s JavaScript folders and
creating an Action that executes the JavaScript.

For an example, see the article
[Extract PDF Pages Based on Content](http://khkonsulting.com/2014/04/extract-pdf-pages-based-content/).