0 Replies Latest reply on Oct 17, 2015 10:01 AM by Powerbook

    Cannot save PDF to Container

    Powerbook

      I do not understand what I'm doing wrong.

      I'm still testing Filemaker Server14 and I'm working on a new solution. But now I reached a point where I got stuck

      The enclosed script works fine under Filemaker Pro, But when I try to run it under WebDIrect, no matter if windows or Mac, also with the option "Perform script on server" it Does not work....

      The Idea is to create a PDF from a Layout and store it under a Container Field set up for storing a file.

      I followed different Filemaker Helps  in order to write a script able to work under Mac and Windows, but I cannot get it to work.

       

      Can Anybody help me?

       

       

      Go to Layout [ “Tessera Socio” (Base) ]
      Set Variable [ $filePath; Value:Choose ( Abs ( Get ( SystemPlatform ) ) -1 ;

      /*MAC OS X*/
      Get ( DesktopPath ) & "report.pdf"

      ;
      /*WINDOWS*/
      "filewin:"& Get ( DesktopPath ) & "report.pdf") ]

      Save Records as PDF [ File Name: “$filepath”; Records being browsed ]
      [
      Document - Compatibility: Acrobat 7 and later ]
      [
      Pages - Number Pages From: 1; Include: All pages ]
      [
      Security - Printing: High Resolution; Editing: Any except extracting pages; Enable

      copying; Enable Screen Reader ]
      [
      Initial View - Show: Pages Panel and Page; Page Layout: Single Page; Magnification:

      100% ]
      [ Restore; No dialog ]

      Go to Layout [ “LayoutContainer” (LayoutContainer) ] // Go to Field [ LayoutContainer::Container ]
      Insert File [ LayoutContainer::Container; “$filepath” ]

      If [ Get ( LastError ) // File Insert was canceled. ]
      Show Custom Dialog [ Message: "L'inserimento del file è stato annullato. Il cassetto

      non p stato modificato."; Default Button: “OK”, Commit: “Yes” ]

      End If

      Show Custom Dialog [ Title: "Creato file PDF"; Message: "Il report in formato PDF è stato creato.¶Lo potete vedere/scaricare cliccando su bottobe 'Cassetto'"; Default Button: “OK”, Commit: “Yes” ]

      Go to Layout [ “Menu Iniziale” (Base) ]
      Move/Resize Window [ Current Window; Height: 850; Width: 1200; Top: 0; Left: 0 ]