Jump to content

Customers can't open my PDF's


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

Recommended Posts

Posted

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?

Posted

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.

Posted (edited)

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
Posted

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.

Posted

It's my impression that the Temporary folder was cleared by the OS, when it feels like it, prior to FM10.

Posted

"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.

Posted

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

If I read this correctly, the pipe character is part of a FIELD name, not of the result. AFAIK, it shouldn't cause any problems - at least not within Filemaker.

Posted (edited)

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
Posted

Is the field name ID | Job?

That's what it looks like to me. But we don't know what's inside that field - and that definitely goes out to the file name. I believe it would be best if Donkick posted one of those problematic files.

Posted

Thank you all for so much help on this. The pipe is part of the field name and can easily be changed to an underscore.

How do I post my file up on the forum?

Posted (edited)

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
Posted

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).

Posted (edited)

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
Posted

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

Posted

cleared by the OS, when it feels like it

I'll accept that as plausible, albeit rather un-scientific or for that matter even proveable.

This topic is 5600 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.