Hi 4wd,
Wow. Many thanks. This is fantastic. 
-jity2
You're welcome

I did some tests and the only small things that are not working are :
- it doesn't delete empty folders of folder1 (if some subfolders are empty or not with other kind of files).
It just needs to call the Delete-SmallPDF function again after doing the Check-PDF function.
Not sure whether you mean folder1 should be completely empty at the end or not since files that aren't PDF will be remaining - ie. delete everything in folder1 after running the Check-PDF function.
In which case, what happens to the non-PDF files that were in the folders?
Delete or move with PDF?
Testing for text PDFs ...
Move-Item : Cannot retrieve the dynamic parameters for the cmdlet. The specified wildcard character pattern is not valid: [Lac_ven_Drnyvn,_Sr_ehajoe_Uduizn,_Giles_Suilo-Sm(e-kjd.org).pdf
At C:\Users\E\Documents\test\jityPDFt3v5_7zip.ps1:82 char:7
+ Move-Item "$($files[$i])" -Destination "$($outfile)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Move-Item], ParameterBindingException
+ FullyQualifiedErrorId : GetDynamicParametersException,Microsoft.PowerShell.Commands.MoveItemCommand
Then, the test "for text PDFs" stops and the other same kind of files are not processed.
Also if the pdf file has "[" in its filename, it ignores it (but creates an empty folder in folder2 if the pdf is located into a subfolder).
The replace strange characters in the filename was going to be part of the too long filename function, just haven't got there yet.
Can you zip up some of the PDFs it stops on, (strange characters, etc - 3 or 4 would be good) ?
Unfortunately, going to be a bit busy this week so might not get back to this until next week, I'll see how I go.
EDIT: OK, besides having a full path less than 260 characters, you can apparently only have a full directory path of 247 characters maximum.
ie.
C:\plus 243 characters\ (max 247 chars)
C:\plus 243 characters\16characters.pdf (max 259 chars)
Otherwise you get this:
New-Item : The specified path, file name, or both are too long. The fully qualified file name must be less than
260 characters, and the directory name must be less than 248 characters.
ADDENDUM: Give the
update a try, it should remove any special characters from file names and in theory it'll shorten filenames if it's the length of the filename that pushes the total path length over the 259 character limit.
If, however, it's the path that exceeds the 247 character limit then the file won't be touched, it'll remain in the initial folder ... so goes the theory

ie.
- If the filename has diacritics and various other strange characters, they'll be removed. (At this point no rename happens.)
An example: This:
François-Xavier!!#@$%^&()_+}{ €$¥£¢ ^$.+()[{ 0123456789.pdf will turn into this:
FrancoisXavier()_ Yc () 0123456789.pdf- If the folder path is less than 248 characters and the full path is less than 259 characters, the file will be renamed.
- If the folder path is less than 248 characters and the full path is greater than 259 characters, the new filename will be truncated and then the file is renamed.
- If the folder path is greater than 247 characters, nothing happens - the file isn't renamed, it will remain in the initial folder.
I might have to tweak the Get-ChildItem statement in the Check-PDF routine to ignore file paths greater than 259 characters, see how you go.
Currently doesn't check for the existence of a file with the same name before renaming.