Cannot view PDF successfully after file transfer via PowerShell script
I have a PowerShell script that is used for transferring XML and PDF files. For both types of files, it performs the following operations separately:
Basically steps 2 and 3 combined perform a move operation (There is probably a better solution for this, I know, but it works for me for now.)
When I run the script, the files are transferred successfully without a problem. There is no problem with the XML's, but when I try to view the PDF files that are transferred, I get a blank page saying "There was an error processing a page. Invalid colorspace". I tried viewing on different browsers and in my local disk, but that did not help.
One of the things I am suspecting is, that the file format might be messed up during the transfer, possibly because of some parameter in
- Copies files (
\*.pdf
) from remote folderA
to local folderX
viasession.GetFiles
- Copies files (
\*.pdf
) from remote folderA
to local folderTEMP
viasession.GetFiles
. After copying, files in folderA
are deleted (because the parameterremove
is set totrue
)
- Copies files (
\*.pdf
) from local folderTEMP
to remote folderB
viasession.PutFiles
. After copying, files in folderTEMP
are deleted (because the parameterremove
is set totrue
)
TEMP
folder.
Basically steps 2 and 3 combined perform a move operation (There is probably a better solution for this, I know, but it works for me for now.)
When I run the script, the files are transferred successfully without a problem. There is no problem with the XML's, but when I try to view the PDF files that are transferred, I get a blank page saying "There was an error processing a page. Invalid colorspace". I tried viewing on different browsers and in my local disk, but that did not help.
One of the things I am suspecting is, that the file format might be messed up during the transfer, possibly because of some parameter in
GetFiles
/PutFiles
. I looked but could not find an answer. I would appreciate any suggestion as to why this might have happened.