7 Replies Latest reply on Dec 3, 2008 1:38 PM by DrDave

    Save Records as PDF

    DrDave

      Summary

      Save Records as PDF

      Description of the issue

      I am saving a layout to a PDF and it works great...except when I try to specify some of the PDF options. I created some variable ($cTitle, $cSubject, $cAuthor, $cKeywords) and use those variable in the PDF options dialogue. When I open the FM-created PDF and look at the properties, the Title and Subject are present, but the Author and Keywords are blank. Is this a known bug? Is there somewhere I can learn about "known bugs?" Thank you. 

        • 1. Re: Save Records as PDF
          TSGal

          DrDave:

           

          This is not a known bug, and I am unable to reproduce it.  This is what I just did.

           

          1. I launched FileMaker Pro 9.0v3 and a test file (a.fp7).

           

          2. I went into ScriptMaker and created a new script with the following steps:

           

          Set Variable [$var1; Value: "Variable1" ]

          Set Variable [$var2; Value: "Variable2" ]

          Set Variable [$var2; Value: "Variable2" ]

          Set Variable [$var2; Value: "Variable2" ]

           

          Save Records as PDF [ Restore; No dialog; "TSGal.pdf"; Current record]

           

          --------

           

          I set the following options for the PDF:

           

          Title: $var1

          Subject: $var2

          Author: $var3

          Keywords: $var4

           

           

          When I run the script, the file TSGal.pdf is written to the Desktop.  When I perform "Get Info", I get the following information:

           

          Title: Variable 1

          Authors: Variable 3

          Description: Variable 2

          Pages: 1

          Dimensions: 612 x 792

          Security method: None

          Content Creator: FileMaker Pro 9.0v3

          Encoding software: Adobe PDF Library 6.1

          Keywords: Variable 4

          Last opened: Today at 9:24 AM

           

          -----------------

           

          Are you sure you have an Author and Keywords for the record you are exporting to PDF?  How about putting four extra fields on the layout and using the Set Field script step to put the variables into these fields?

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Save Records as PDF
            DrDave
              

            Thank you for your suggestions...but I fixed variables in this instance already. I printed my code and here is the output. I hope code in this format is okay.

             

            Go to Layout [ “zContainerLayout” (Competitor) ] 

            Set Field [ Competitor::zKounterDisplay_n; 0 ] 

            Refresh Window 

            # 

            #Setup Kounters and Display Values 

            Set Variable [ $cFilePath; Value:"filemac:/" & "Drive-1/Users/dHillock/dhTempReportCards/" ] 

            Set Variable [ $cFullName; Value:"" ] 

            Set Variable [ $nKounter; Value:0 ] 

            # 

            #Used For Testing 

            Set Variable [ $nShowKounter; Value:25 /* When to update the display Kounter */ ] 

            Set Variable [ $nStopWhenKount; Value:9999 /* Use this for testing - only do X loops. Specify a small # for test or 99999 */ ] 

            # 

            #Set PDF Options 

            Set Variable [ $cTitle; Value:"115 Toronto International Salon of Photography: Report Card" ] 

            Set Variable [ $cAuthor; Value:"Salon Chair: David Hillock" ] 

            Set Variable [ $cSubject; Value:"See Below" ] 

            Set Variable [ $cKeyWords; Value:"115 Toronto International Salon of Photography" ] 

            Set Variable [ $cChangePassword; Value:"NotThePassword" ] 

            Set Variable [ $cOpenPassword; Value:"" /* Leave empty for no password */ ] 

            # 

            # 

            Set Field [ Competitor::zKounterDisplay_n; $nKounter ] 

            Freeze Window 

            Go to Record/Request/Page 

            [ First ] 

            # 

            # 

            #Use this for testing 

            Perform Find [ Specified Find Requests: Find Records; Criteria: Competitor::CompetitorID: “935” AND Competitor::S115: “115” ] 

            [ Restore ] 

            # 

            # 

            # 

            # 

            Loop 

            If [ Competitor::S115 = 115 

            /* Competitor::MailReportCard=0 */ ] 

            Set Variable [ $cFileName; Value:"C" & GetAsNumber ( Competitor::CompetitorID ) & "08.pdf" ] 

            Set Variable [ $cFullName; Value:$cFilePath & $cFileName ] 

            Go to Layout [ “Report Card - Contents” (Competitor) ] 

            Enter Browse Mode 

            Set Variable [ $cSubject; Value:"Report Card For: " & Competitor::zNamesBothLastFirst_cal ] 

            Save Records as PDF [ File Name: “$cFullName”; Current record ] 

            [ Document -  Title: $cTitle; Subject: $cSubject; Author: $cAuthor; Keywords: $cKeywords; Compatibility: Acrobat 6 and later ] 

            December 3, 2008 13:06:01 -1- 

            Competitor.fp7 - ReportCards - Generate

            ReportCards - Generate 

            Save Records as PDF [ File Name: “$cFullName”; Current record ] 

            [ Document -  Title: $cTitle; Subject: $cSubject; Author: $cAuthor; Keywords: $cKeywords; Compatibility: Acrobat 6 and later ] 

            [ Pages -  Number Pages From: 1; Include: All pages ] 

            [ Security -  Password to open; Password to print/edit; Printing: High Resolution; Editing: Not Permitted ] 

            [ Initial View -  Show: Page Only; Page Layout: Single Page; Magnification: Fit Page ] 

            [ Restore; No dialog ] 

            Go to Layout [ “zContainerLayout” (Competitor) ] 

             

            I stripped the rest of the code here because of message limit. 

            • 3. Re: Save Records as PDF
              TSGal

              DrDave:

               

              I used the same values as you have.  I did not include the protected PDF file.  I don't doubt this isn't happening to you, but I cannot duplicate the problem.  For each of my files, I get all four variables into the file.

               

              Although the rest of the loop isn't showing, I am assuming the values for $cAuthor and $KeyWords is not changing. 

               

              How many times does the loop execute?

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Save Records as PDF
                DrDave
                  

                You are correct TSGal...the $cAuthor and $cKeyWords are not changing.

                 

                I'm looping through the database 359 times.

                 

                I'm using Acrobat Professional 8.1.3

                 

                Also, when you say you do a "Get Info," is that from the Mac Finder? When I do that I don't see the details that you presented earlier.

                 

                DrDave

                • 5. Re: Save Records as PDF
                  TSGal

                  DrDave:

                   

                  Yes, I'm doing this from a Mac, so it would be from the Mac Finder.

                   

                  In your first file, you should be able to see the Author and Keywords.  In your second file, since it is password protected, you will not see the Author and Keywords.

                   

                  I will set my loop for 1000 iterations.

                   

                  TSGal

                  FileMaker, Inc. 

                  • 6. Re: Save Records as PDF
                    TSGal

                    DrDave:

                     

                    After running my looping script, I looked at the first 300 records and last 100 records with Get Info and every file had Author and Keywords (along with Subject, Title, etc.).  I don't want to spend any extra time going through the other 600 records (it took 20+ minutes for the files I did see).  I'm not sure what else to do at this point.

                     

                    What other applications are running?  I'll repeat the process again if need be.

                     

                    TSGal

                    FileMaker, Inc. 

                    • 7. Re: Save Records as PDF
                      DrDave
                        

                      FM is off the hook! Thank you for your help.

                       

                      You provided information that really helped here -- the password. I never thought that having a password would effect the displaying of Author and/or Keywords.

                       

                      What I discovered is that the information DOES show up in the "get Info" screen, which I never used, until after I reported the problem. Instead, I was using the Properties Dialogue within Acrobat...and this information (Author and/or Keywords) is still not showing, regardless of the password.

                       

                      It looks to me as though it's an Adobe problem. I'll pursue it in the Adobe forum.

                       

                      Once again, your help has been stellar! Why don't you go home early today! I'm a Doctor, I could write you a note. :-)

                       

                      DrDave