I ave an application that makes use of charts. I would like to have a button for the user to save the chart as a PDF. I tried to have the button save the PDF to the user's document directory directly. That attempt failed. But I was able to save the PDF to the application sandboxed documents directory. The question is how to programmatically move that file from the application documents folder to the user's general documents folder. So far I have not been able to find a method that will move the PDF file. Any ideas?
Copy file in application document file to user Documents file
You didn't specify what platform you're using. On iOS, you need to use a UIDocumentPickerViewController. On macOS, use an NSSavePanel.
Both these methods allow you to export a file from the app sandbox into user-specified locations.
Based on your suggestion I found a simple way to accomplish the task. I feed the url for the pdf that is created to Preview which displays the file. From here the user can save the file or print it. Thanks for your help