Jump to content
Server Maintenance This Week. ×

Customers can't open my PDF's


Donkick

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

Recommended Posts

I have a script that creates a PDF invoice to be e-mailed to my customer.

I am using this script step:

Save Record as PDF (Restore; No dialog; "$exportPath"; Records being browsed)

Then the script attaches the PDf to an e-mail using the Send Mail script step.

The problem is that many people are reporting that they cannot open the pdf, however if I manually save the pdf and then attach it to an e-mail they can open the PDF just fine. What is the difference?

Any suggestions?

Link to comment
Share on other sites

1 more point, the problem seems to be in "Save Record as PDF" because even if I manually save the file the script has created to another e-mail it won't open for my customers. It's only when I manually save the PDF that it works.

Link to comment
Share on other sites

I think it should be:

Get (DocumentsPath) & "Invoices/" & "Inv_" & Line Item::ID & " | Job.pdf"

I'm not sure if the pipe is causing a problem.

You could use Get (TemporaryPath) rather than storing all these pdfs.

Edit: What is the name of the field in Line Item? I've assumed it's ID, and that you wish to append " |Job.pdf" to the file name. If the field name contains a pipe, I'd definitely change that to an underscore.

InvoiceDemo.fp7.zip

Edited by Guest
Link to comment
Share on other sites

The temporary folder is SUPPOSED to get cleared when FM quits - however this did not happen until FM10.

I tested this myself in FM9, and presume the same is true in FM8 - the version you are running.

Link to comment
Share on other sites

"The problem is that many people are reporting that they cannot open the pdf"

If you have pipe in the file name AND if any of your Users are on Windows, it would be a problem ... pipe is an invalid file name character for Windows.

Link to comment
Share on other sites

Well obviously none of us really knows ... I saw the parentheses which make no sense either in this type of field name concatenation because it would need to be quoted out. Is the field name ID | Job?

If the pipe ends up being part of the file name, it will break on Windows. That was my point and my only point. It didn't appear that the problem was within FileMaker but rather when attempting to open the final PDF file. And if the final file name was the field DATA 327 | JOB, it would certainly create a problem on Windows. :wink2:

Edited by Guest
Corrected field name to field data
Link to comment
Share on other sites

Okay, I have posted the file here.

Open the file as a guest, you will have full access.

You can go straight to The problem script it's the top one in the Scripts: E-Mail Invoice

or

Click the Job Number 7054 to open the Order

There is an Invoice Tab, in the "Job Detail" Layout. That will have a button to activate the script (highlighted in orange).

Let me know if you have any problems...

Invoicing.fp7.zip

Edited by Guest
Link to comment
Share on other sites

We may not need it, Michael.

When the email is created, the icon on the attachment line of the email doesn't turn into the PDF icon. If we look closely at the variable, we will see a space after the pdf:

Get (DesktopPath) & "Inv" & Line Item::ID_Job & ".pdf "

Remove that space and it properly creates the pdf (and you will know it works because the file icon on the attachment line turns into the pdf icon (at least on Windows this is how it displays).

Link to comment
Share on other sites

That's funny! Actually, this is interesting... The forum will not allow me attach the problem pdf. In other words the message says that it contains an invalid file extension, but it does have the same exact .pdf extenion as the one that works.

(just a note, the pdf that is created manually will attach just fine!)

Edited by Guest
Link to comment
Share on other sites

YOU ARE AMAZING LaRetta!!!!

Yes, that space after the .pdf was the problem.... it works now!

All this frustration over a tiny little error. Thank you so much for all the time and help you have all put into this!

-Thank You - Don Kick

Link to comment
Share on other sites

This topic is 5322 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
×
×
  • Create New...

Important Information

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