Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.2K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to get .pdf files to actually show up in my Cloud files?

Posted 2 years ago

I was wondering how to convert a Wolfram notebook to a pdf so I can print it? And once its converted, how to access it in Cloud? My progress so far:
I have three files, called BesyWay.nb, AnotherWay.nb, AThirdWay.nb. Ive got the system to cpnvert these to pdf (I think), using the following code:

Export["BestWay.pdf", Get["BestWay.nb"]]
Export["AnotherWay.pdf", Get[["AnotherWay.nb"]]
Export["AThirdWay.pdf", Get,["AThirdWay.nb"]]

When I run each line of code in its own separate cell, , the output gives me a .pdf file name, and the option to open this file. All this in a little box below the output gile name. So i click on "open", and I get the output

SystemOpen[BestWay.pdf]

for example. I even try running this code. As a check that the pdf file BestWay.pdf is really in the system, I try running the following code:
Import[BestWay.pdf] And when I do that, the output gives me an image lookong just like the file I want in pdf. I even click on extract image, and it gives me a bigger copy of the image (but very bad quality and I cant use it). So, all this shows me that the pdf file, BestWay.pdf, is somewhere in the system. But when I look in my files, eg All my Files, Recent Files, etc, it doesnt show up, nore when i try searchong the system for it. When i go to Recent Files, all i see is my .nb files, even though my .pdf files are somewhere in the system. So my question is, how do i get my .pdf files to show up, eg in Recent Files, along with my .nb files, sp that i can access my .pdf files? Also, how do I then save them yo my device so that I can print them out?

POSTED BY: Lewis Jones
Posted 1 day ago

Lewis,

That's a very common confusion when moving from a desktop environment to the Wolfram Cloud!

The reason your PDF files are not showing up in your Cloud file list is because you are currently exporting them to a temporary working directory on the Cloud kernel, not your persistent Cloud storage.

Here is the explanation and the corrected steps to successfully create, view, and download your PDF files.

The Core Problem: Cloud Paths

When you use a simple file name like "BestWay.pdf" in the Cloud, the Wolfram Language saves it to the local working directory of the Cloud kernel, which is a temporary, hidden location that is cleared when your session ends.

To make the file permanent and visible in your "All my Files" or "Recent Files" view, you must use a Cloud Path, which starts with cloud:///.

Corrected Code to Export to the Cloud

You need to use CloudGet or Import to read the notebook's content, and then Export it directly to a path that specifies your persistent Cloud storage:

(* Use CloudGet to retrieve the notebook content from your cloud storage *)
notebookContent = CloudGet["BestWay.nb"];

(* Export the content to a new, visible location in your cloud storage *)
Export["cloud:///BestWay.pdf", notebookContent];

Export["cloud:///AnotherWay.pdf", CloudGet["AnotherWay.nb"]];
Export["cloud:///AThirdWay.pdf", CloudGet["AThirdWay.nb"]];

After running this corrected code, your three PDF files should appear immediately in your "Recent Files" and "All my Files" folders.

How to Access and Print the PDF

Once the files are saved to your persistent Cloud storage, you have two simple options to save them to your local device for printing:

Option A: Using the Wolfram Cloud Web Interface (Recommended)

  1. Go to your Wolfram Cloud File System interface in your web browser
  2. Navigate to where you saved the files (e.g. your home folder).
  3. Right-click on the BestWay.pdf file
  4. Select Download

Option B: Using Code in a Desktop Notebook

If you are running Mathematica/Wolfram Desktop on your device, you can use the following command to retrieve the file from the cloud and save it locally:

(* This downloads the cloud file to your local computer's working directory *)
CloudGet["cloud:///BestWay.pdf"]

The output of this command will be a file object that you can then open or save locally. For a more explicit local save:

CopyFile["cloud:///BestWay.pdf", FileNameJoin[{$TemporaryDirectory, "BestWay_local.pdf"}]]
SystemOpen[FileNameJoin[{$TemporaryDirectory, "BestWay_local.pdf"}]]

This forces the download to a known local path and opens it for you to print.

POSTED BY: Rob P
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard