1 2 Previous Next 16 Replies Latest reply on Apr 13, 2016 8:27 AM by justinc

    FM Go, 'save records as pdf' document is corrupt?

    justinc

      I am trying to get a layout designed for printing to export from the iPad so that it can be emailed to a customer.  The records are browsed on the print layout, then exported to the Temp path.  It then inserts that file into a container, the idea being that the customer could then review the document before signing it.

       

      But the document appears to be coming out corrupted - it's just a black screen when viewed on the iPad.  The container on the layout just shows a basic PDF icon instead of the document itself.  All of these functions work correctly from FMPro on my computer.  But when a correct PDF is viewed on the iPad the container still only shows a thumbnail of the first page - it's not interactive.  That's kind of the whole point of this process...be able to review what you are signing, you know?

       

      FMGo 14.04, iOS 9.3;  FMPro 14.05, OSX 10.9.5.

       

      Thanks,

      Justin

        • 1. Re: FM Go, 'save records as pdf' document is corrupt?
          rgordon

          PDFs in a container field are not interactive on an iPad. If the PDF is only one page you can view it in the container. Two options for you are to view the PDF through a webviewer or to just open the PDF.

          • 2. Re: FM Go, 'save records as pdf' document is corrupt?
            justinc

            Well that's annoying.

             

            Any idea about blank documents being created?  Is that a  layout issue, perhaps?  (The previous step in my saga to get to this point involved the PDF creation process closing the file that was running on the iPad.  This appeared to be due to a flaky/corrupted layout element; it was one of four column header lables, with some hide conditions on them.  I recreated the same elements from scratch with the same formatting and hide conditions and it stopped closing the file when 'save as pdf' was run.)

            • 3. Re: FM Go, 'save records as pdf' document is corrupt?
              rgordon

              When is the last time you restarted your iPad?  Sometimes just doing a restart of the iPad will correct problems with PDF files.

              • 4. Re: FM Go, 'save records as pdf' document is corrupt?
                justinc

                It has been awhile since I last restarted it.  I did that, but it doesn't appear to have helped - I still get a black empty screen when trying to view the file created on the iPad, on the iPad. 

                • 5. Re: FM Go, 'save records as pdf' document is corrupt?
                  rgordon

                  If you create a PDF with the print command in fmgo, can you get a readable PDF?  If you post your file, I would be happy to do some testing on the file.

                  • 6. Re: FM Go, 'save records as pdf' document is corrupt?
                    justinc

                    I'll try the Print output.  Might be a while. 

                    • 7. Re: FM Go, 'save records as pdf' document is corrupt?
                      justinc

                      OK, not so long - got too curious.

                       

                      That does appear to work.  I was able to bring up the Print window, pick PDF and both 'View' or 'Save' the file, then insert that into the Container.

                       

                      I happened to notice that the older files, the ones that were blank, were only 78 bytes in size.  Explains why they were blank.

                      • 8. Re: FM Go, 'save records as pdf' document is corrupt?
                        rgordon

                        Get rid of all of the old small files and then run your script again to see if it works. If it doesn't the script might not be finding the records to print. Something might be wrong with your script.

                        • 9. Re: FM Go, 'save records as pdf' document is corrupt?
                          justinc

                          Haven't tested it yet - although I did delete the stray documents.  But, the Print step I tested was using the same 'find records' routine, and it came up with a valid document.  So I would think that's not the problem.  I'll double check.

                          • 10. Re: FM Go, 'save records as pdf' document is corrupt?
                            justinc

                            So I created a new layout from scratch (using the wizard) and put some of the relevant fields on it.  Using this layout in my script for the output generates a valid PDF document.  So, it looks like I might be rebuilding the rest of the layout now...but what was on it in the first place that made it fail?  Would be nice to know so I don't do it again.

                             

                            BUT, after switching my script back to exporting to the Temp directory and using the 'save as pdf' & 'insert pdf' steps, I am always getting a window 'Files on Device' at the 'insert pdf' step.  There are no files listed (because they weren't saved in the Documents path) and so you have to cancel the window; this cancels the insert step and generates an error.  I'm using the same path as used to save the file out to the Temp path, but with the "image:" prefix on it.  This problem is also happening in another test file that I downloaded from Soliant - I didn't edit or change those scripts.

                             

                            So why is it showing me this window now, and not inserting the file I specify?  Here's what that immediate section looks like.Screen Shot 2016-04-11 at 21.28.55 .png

                             

                            --  Justin

                            • 11. Re: FM Go, 'save records as pdf' document is corrupt?
                              rgordon

                              Rremove the image: from the iPad path.   The iPad doesn't understand the path with the image:  that is why you are being prompted to find the file.

                              • 12. Re: FM Go, 'save records as pdf' document is corrupt?
                                justinc

                                I'll give the non-prefix a shot.  But it wasn't doing this before, and it was inserting PDFs, albeit the blanks ones.  Bah...I have been through enough iterations that I could be confusing something.

                                 

                                The documentation says that "image" is required for "Creating File Paths" page: 

                                ...  "To create a file path for use with the Insert PDF script step or the Insert Picture script step, begin the file path with image, imagemac, or imagewin."

                                 

                                And here, from "Insert PDF" help docs:

                                "...The file path must begin with image, imagemac, or imagewin."

                                 

                                And lastly, the demo from Soliant that I mentioned above uses the 'Image' prefix.

                                 

                                I don't know if all of that is related to getting interactivity to work, so that FM knows (vaguely) what 'type' you are inserting, as opposed to just a simple 'insert file' operation, but I do recall not getting the interactivity without using the "image" prefix.  But that was on my laptop.

                                • 13. Re: FM Go, 'save records as pdf' document is corrupt?
                                  rgordon

                                  The FileMaker documentation needs to be upgraded to include FileMaker Go.  Btw, I tried the Soliant file on my iPad and it did not work. The PDF could not be found. There is also another problem with the Soliant file, you can not delete a file using the Export Field Contents step.

                                  • 14. Re: FM Go, 'save records as pdf' document is corrupt?
                                    justinc

                                    Well, that appears to have gotten rid of the bothersome dialog - removing the "image" path prefix.  And I recreated my layout from scratch using a base created by the FM layout wizard; I modified things as minimally as I could.  It all appears to be working well now!

                                     

                                    Thanks for you all your help, RGordon.

                                     

                                    One last question - I have some navigation buttons on my iPad layouts that do a simple 'Go To Layout'.  But when they are pressed there is a brief toolbar that shows up at both the bottom and top of the screen.  So a light gray bar slides up (about....10pixels high?) and then slides back down when they are pressed.  It only happen on two of three layouts that I am currently using.  Any ideas what's causing it?

                                     

                                    --  Justin

                                    1 2 Previous Next