PDF Documents Storage

Is there anyway to store a PDF file in a Pan X database? Or even link to it on my hard drive? Thanks

Doug Canning

Yes to the second part of the question. You can use the filecatalog statement / function to import the contents of a folder with PDF files as file paths into Panorama X, and you can then the openanything statement to open that path.

…and, if it’s useful for your purposes you can preview the PDF from within your PanX database in a web browser object. Prefix the file path with"file://" to view it in the browser. I like to add code to my browser object to open the file in Preview if the user double clicks on the web object, using “openanything” as per KJM’s reply.

Thanks, will give it a go

One more consideration, you can drag a PDF from the Desktop to an active cell or text editor and Panorama will enter the full file path. It sure makes it easy and eliminates typos or other errors.

I too use the openanything statement to open a specific file but I add an enhancement.

openanything PATH

The data is the entire path of the document (it does not have to be a pdf document) and I include an option such that if the option key is depressed, I clip or trim the last part of the path with a simple text funnel of the actual document path.

This then will open the Folder instead of the document in the folder.
Code
;---------Named “.RetrieveDocument”
if info(“modifiers”) contains “Option”
;then-this opens the folder since I have
;trimmed off the document name
openanything «Path»[1,“-/”]
else
;this opens the actual document
openanything «Path»
endif
End Code
That James Cook “trick” for getting the path is fantastic. What a time saver and error mitigator.

I can’t seem to indent the actual code. Sorry.

Your trick will work, but instead I would suggest this:

if info("modifiers") contains "option"
    revealinfinder Path
else
    openanything Path
endif

This will not only open the folder in the Finder, but select the document in that folder.

Just put 4 spaces in front of each line. If the code is already in a Panorama procedure, you can simply select the code, then choose Source>Copy Indented Code.