I tried using code above. I am not able to save pdf correctly. It is giving me error message of corrupted pdf. When i try going to url provided by variable
outDoc.remoteURL I am able to see pdf stored in GDS. I am not sure how this file is getting corrupted while writing to the directory. Also how can I dsiplay this pdf on the screen instead of saving it to a directory?