14 Replies Latest reply on May 7, 2014 2:31 PM by DeanIngram

    PDF Export error

    TomGoedhart

      Title

      PDF Export error

      Post

      Hi all,

      Over the last year i developped a filemaker database to manage our projects and invoices. The database runs great except for one thing; exporting pdfs. When i create an invoice, filemaker runs a script that creates a new folder with the customer name and project number. In this folder it wil have to export a pdf from the invoice. This folder is on the same server as where filemaker server hosts the database. Creating the folders is no problem only when it try's to export the pdf to that folder i get the following error:

      “Untitled.pdf” could not be created on this disk.  Use a different name, make more room on the disk, unlock it or use a different disk.

      At first i thought it had something to do with the permissions on the server so i tried to export in the desktopfolder from the client computer. But that still gives me the same error. I also thought it had something to do with the database being on a server, so i copied the database to the client computer, tried to export to pdf and there's the error again. To make the problem even stranger: sometimes it does export a pdf without any problem....

      When i build the database it just worked, after i ran it from a server it didn't. I doesn't matter wich layout i try to export, it almost always gives me an error. I don't know why it does export sometimes. I don't do anything different.

      I tried to google this problem to solve it but without any luck so far. Does somebody knows the solution?

        • 1. Re: PDF Export error
          JimMac

               What is your FMP version and OS version.  It sounds like a Mac, which is not a problem.  I would need more details on what you do to be successful.

               

                    When i build the database it just worked, after i ran it from a server it didn't.

               Jim...

          • 2. Re: PDF Export error
            philmodjunk

                 The most common cause for this error message is the one the error message does not list: An invalid file path. It will be helpful if you post the file path that you used.

            • 3. Re: PDF Export error
              TomGoedhart

                   Hi Jim,

                   I totally forgot to mention: I'm on a Mac whit Mountain Lion. The server is also Mountain Lion. I'm using Filemaker 12 Advanced. I just select the "Save record as PDF" scriptstep. But also if i select the Save record from the menu it gives me the error.

                    

              • 4. Re: PDF Export error
                TomGoedhart

                     Hi Phil,

                     The filepath is as followed:

                     "filemac:/Storage/"&Invoice::FolderName&"/Invoice_"&Invoice::Invoicenumber&".pdf"

                     But as previously mentioned, sometimes it will export. And when i select a folder manually for example the Desktop via the menu, it also gives me the error.

                • 5. Re: PDF Export error
                  JimMac

                       Tom, I still not sure what you are trying to do.  I think your are creating a Layout that is an invoice, then saving that invoice record Layout as a PDF file in a external referenced folder.  The file path will change relative to the server DB and will be different than the Client's.  

                       Do you have Container's in your layout?

                       Does everyone have FMP permisson, not Mac permission, to print when using the Server DB version?  In essense FMP is "Printing" to a PDF file.

                       After you successfully Save the invoice record in PDF format, what do you intend to do with that file?

                       Jim...

                       PS: Remember if you sign into the server to change or test the Server DB file, you must "Open Remote" with full FMP permissions.

                  • 6. Re: PDF Export error
                    philmodjunk

                         Hmmm, since Tom gets an error even when saving to the desktop, I'd be concerned that user account permissions on the client computer may have a problem. But even the tinyiest detail wrong in your file path for the current user, can trip this error.

                         I recommend using a variable to compute a 'safe path' for testing purposes such as:

                         Set variable [$Path ; "file:" & get ( DesktopPath ) & "YourFilenameHere.PDF"]

                         Then type $Path (no quotes) in where you are currently specifying the file path for your exported PDF file.

                         If that still trips an error the problem is external to FileMaker, check your user account permissions.

                         If it works, you'll need to debug your filepath to get it to work.

                    • 7. Re: PDF Export error
                      TomGoedhart

                           Hi Phil and Jim,

                           Sorry for the late response, i'm only on location on wensday. 

                           I 'print' to PDF. I checked my permissions and i got full permission. When an project is done it prints an invoice and it exports the invoice to the projectfolder. Printing works fine, only the 'print'/export to PDF won't work. I don't have containers on the invoice layout.

                           I changed the filepath to the variable but still get the folowwing error:

                      “YourFilenameHere.PDF” could not be created on this disk.  Use a different name, make more room on the disk, unlock it or use a different disk.

                           It's driving me crazy! Especially because i used to work. I get this error on all the macs (7). And sometimes a PDF will be created and will be exported to the right folder.

                           Any thought left?

                            

                      • 8. Re: PDF Export error
                        philmodjunk

                             I suggest posting the exact script that you are using. So far we only have seen bits and pieces of it and the crucial detail may be in the parts of the script that we have not yet seen.

                             To post a script to the forum:

                               
                        1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
                        2.      
                        3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
                        4.      
                        5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
                        6.      
                        7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
                        • 9. Re: PDF Export error
                          TomGoedhart

                               Hi Phil,

                               This is one of the scripts i use wich wil give me the error

                          • 10. Re: PDF Export error
                            philmodjunk

                                 I can see possible issues to check.

                                   
                            1.           You have a go to related records step, but there is no code to check to see if any related records actually exist. Perhaps that never can happen, but if there are no related records, no error message interrupts your script and the script does not take you to the "pakbon afdrukken" layout, leaving you on the original layout.
                            2.      
                            3.           Your set variable expression refers to Orders::FolderName and also to Orders::Ordernummer, but your Go to Related records step (assuming there were related records present), has changed "context" to a layout based on Ordergegevens | Orders. That may not be a problem, but since I don't know the relationships involved, I am pointing it out as the relationshp between Ordergegevens | Orders and Orders will now determine what values are used in this calculation and it is possible (depends on the relationship) that the values may now come from a different record.

                                  

                                 If you have FileMaker Advanced, you might enable the script debugger and data viewer and watch to see what value appears in $filepath just before the save as pdf step to check for any possible problems in that path.

                                 If you do not have advanced, you may want to put a show custom dialog with this variable in the custom dialog just before the Save As PDF step as a way to check the value of the variable.

                            • 11. Re: PDF Export error
                              JimMac

                                   Here is addtional thoughts.....

                                   1) Perhaps you have an "true error".  You file size may be too big for the disk.  On Save Records as PDF script step, change option to Save Current Record and NOT "records being browsed".  Depending on your "Found Set" record count, that PDF file could be hundreds of pages long!surprise

                                   2) You shouldn't need the Perform Applescript step to mount a volume [Opslag], the volume [Opslag] should be mounted to have the Filepath work. If you don't see the [Opslag] volume image on your MacOS desktop on the Server, you have a volume problem.

                                   Try using your FMP advanced trace to see what part of the Script is causing the error.  If you don't know how to do that, i like a quick check useing the Speak script step on a Mac at key points in your script to see if you are getting the error from Applescrip or Save as PDF.

                                   Jim...

                              • 12. Re: PDF Export error
                                JimMac

                                     you said you had FMP12 advanced. so you have the script debugger under the Tools menu.  Read up on how to use it in Help.  then turn on the trace and  you can see where error is occuring,yes

                                     Jim....

                                      

                                • 13. Re: PDF Export error
                                  TomGoedhart

                                       Hi Jim,

                                       I deleted my previous post because i found out something important minutes after i posted here on the forum.

                                       In the system there are several buttons, for printing different things. Most of the times the user prints a sticker on a labelwriter, and a invoice on a normal printer. The script i posted is for printing and saving the invoice. If the user prints a sticker first and then a invoice, you'll get the exporterror. If i try to print a invoice again after the error, it worked! The PDF would save without error.

                                       That made me change the order of the scriptsteps, first i printed the invoice and than i exported the PDF. With succes! Even after hitting the print a sticker button first! So i finally figured it out: When I change the the page-setup for the stickers, i first have to change it back to A4 (Which i did when i wanted to print the invoice), if i do that the error is gone! That's why sometimes it would work and sometimes it wouldn't! 

                                       Thanks for the help and efforts!

                                  • 14. Re: PDF Export error
                                    DeanIngram
                                         I hope you have this fixed by now, but for the benefit of others here's a different solution I found.
                                          
                                         A script that had worked prior to upgrading to FM13 started giving intermittent errors saving a PDF on a client's iMac. It was giving the usual "File.pdf could not be created on this disk.  Use a different name, make more room on the disk, unlock it or use a different disk."

                                         The script still worked on my Mac. Client's Mac would almost never save. The drive was not full. Permissions were ok. It wouldn't always save a PDF directly to the desktop either.
                                          
                                         
The problem appears to have been related to Acrobat Reader. I deleted that application and reinstalled a fresh copy. The saving PDF problem went away immediately after a restart.