Share Copy of Document

Product: PDFTron SDK iOS

Product Version: 9.3.18

Please give a brief summary of your issue:
Using PDFTron share copy function doesn’t work on some files.

Please describe your issue and provide steps to reproduce it:
We have been using the shareCopy function off the PTDocumentController it seems to work great for most files. We have gotten reports of customers not being able to share their documents. We were able to repo. We aren’t storing any files on our side but it seems PDFTron is storing the file in the Documents directory in order to share that file. Well on some instances we get a tmp directory instead and this can cause issues. When it tries to share we get an error saying that file doesn’t exit. Not sure what PDFTron is doing behind the scenes in that function but can get different file paths. (one from the document directory and one from a tmp directory) We pass to the targetFileName the name of the document the user wants without the ext. This is also very puzzling because if we give the targetFileName param just any random String value then PDFTron is happy and allows us to share this document. Is it trying to locate the file name that we provide it? If so why does it work if I provide it a random name? i.e “blob” always works. Also if I don’t provide it with a target file name it works, but gives encoded values or a “-copy”. Hoping to get some insight on what is going on so we can get this resolved.

Here is there error in Xcode:
Error exporting file: Error Domain=NSCocoaErrorDomain Code=260 “The file “test-file.pdf” couldn’t be opened because there is no such file.” UserInfo={NSFilePath=/Users/johnappleseed/Library/Developer/CoreSimulator/Devices/EBF4B0A4-B2F9-4375-A162-373AE25AF2DE/data/Containers/Data/Application/255954CE-C624-467D-BB9E-1759E79D2811/tmp/test-file.pdf, NSUnderlyingError=0x600000db3600 {Error Domain=NSPOSIXErrorDomain Code=2 “No such file or directory”}}

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hi Jack, Thanks for letting us know about this issue. If you can provide a small sample project that reproduces the issue then we’ll be able to look into it on our side. The best way to do that is via our Technical Support: