Jump to content

Naming a PDF?


This topic is 5592 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Can anyone give me the fastest simplest way to name a "save as PDF" file using a field from the current record? All paste, etc. features are greyed out, and scripting doesn't offer any options that I can find. Thanks for your help!!

Link to comment
Share on other sites

Set a variable (say $_output) to the exact path and name where you want to save the PDF under.

(Keep in mind that FM expects the path to be in its own syntax, not the OS format)

Then in the "Save as PDF" script step, in the "specify output file" dialog, just enter the name of the variable: $_output

Link to comment
Share on other sites

Thanks Wim Decorte;

I am having a issue with the path. My script will respond telling me that I must use a different name (the name is correct), to unlock the disk or save to a different disk. Everything I check seems to be fine. It runs, but just won't save the file...

Set Variable [$_output: Value"Erdelt HD/FactTagPDFs/" & LacksFactTag::SkuSort & ".pdf"]

Save Records as PDF [Restore; No dialog; "/$_output"; Current record]

The actual entry in the specify= filemac:/$_output

Any help?

Link to comment
Share on other sites

You get that message when the path is incorrect, i.e., impossible to access. It looks OK to me though. I usually just put the "filemac:/" into the Variable, so I can check for platform (also so I can see it in Data Viewer; which I believe you need Advanced for). Look carefully at the names. Do you indeed have a folder "FactTagPDFs" at the top level of the drive, and is your hard drive (or mounted drive) named "Erdelt HD"? No slashes in the file name? etc..

There may be some error, but I don't see it.

Link to comment
Share on other sites

The actual entry in the specify= filemac:/$_output

No, no...

In the specify output you can only have "$_output".

The "filemac:/" needs to be set in your variable.

The Specifiy Output File dialog is not a calculation window.

Link to comment
Share on other sites

Thanks Everyone! but, I still have a path error. It names correctly, but still says that it can't save to the disk. What is the most generic path name that I can use? I tried [Get (DocumentsPath)], but no file???

If anyone has the time to look, I can try to email the script so you can see how it is set up.

Thanks again.

Link to comment
Share on other sites

You might want to create an unstored calculation field, so you can see what the result is. A common glitch is that the functions like Get (DocumentsPath) return the starting slash. So you'll get an error if you use a calculation like "filemac:/" & Get (DocumentsPath) & "file.ext", because it ends up: filemac:// (2 slashes).

You could upload a clone of your file, and we can look for an error. But, because you've renamed your hard drive, your calculation will not work for anyone else.

Link to comment
Share on other sites

Well, the path is evaluated on the client. You would save the PDF onto the client machine. You'd be using FileMaker 8 on the client. So the fact that the file is hosted on FileMaker 7 I don't think would make a difference. 7 and 8 are the same file format, and it all happens on the client.

Link to comment
Share on other sites

  • 3 weeks later...

So if you want to save PDF files from clients that are running a solution off of a FM server you would need a script with a custom save path for each client?

Can't I just create some sort of generic path that dumps the file into the clients FM folder? The same way exporting files worked in FM5.

Link to comment
Share on other sites

There are several Get() functions that can be used in a calculation to produce a client-specific file path:

Get ( DesktopPath )

Get ( DocumentsPath )

Get ( FileMakerPath )

These produce "FileMaker syntax" paths. The final calculation of the full path, with the correct prefix and the rest of the path, can be put into a script Variable. The Variable can then be used directly in any of the Export/Import steps.

There are several posts here with more specific instructions; but that's the gist of it. It is also explained in the FileMaker Help, though it may take a little jumping around to find it.

Link to comment
Share on other sites

This topic is 5592 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.