I also tried saving the file a little bit differently using PDSaveCopy as shown:
PDDocSave(currentPDDoc, PDSaveFull | PDSaveCopy | PDSaveLinearized | PDSaveCollectGarbage, filePathName, ASGetDefaultFileSys(), NULL, NULL);
But now I get the error: "Cannot write to this file. Please save the document with a different name or in a different folder."
The commands you list seem a bit out of order - there are two calls to
PDDocSave(), one of them before I see the declaration of the path name.
Because we don't know what's going on between those commands, it's
impossible to diagnose your problem remotely.
You are new to plug-in programming, so I would approach this by eliminating
(or commenting out) anything that can potentially modify the PDF file, so
that you just have the calls to get the PDDoc, and then to save that PDDoc
at a different location. Does that work? If not, fix it - if it does work,
add things piece by piece and see where things stop working.
Are you sure you can write to the filename/directory you've selected? Have
you tried a different directory?
Plug-in programming for Acrobat is hard, and there is no way around making
all the mistakes in the world and learning from them
Karl Heinz Kremer
PDF Acrobatics Without a Net
The first PDDocSave somehow snuck in there. It's not actually in the code lol. Only the ones at the bottom are.
Don't close the pddoc before you save it.
When you will get help you should show the correct code.
May be that won't help you, but in our Company, Users have the same error message when they open a PDF on the Internet with IE8 64 bits and then try to save it on their PC.
Everything works fine if they use IE 8 32 bits... it only happens if they launch the 64 bits version of IE 8 on W7.
I'm not sure what you're doing exactly, but if your pluging is using IE 8 64 bits, may be you should try IE 8 32 bits instead.