16 Replies Latest reply on Dec 10, 2008 7:12 AM by (Rasmus_Olsen)

    Setting PDF/X compliancy standard

      Dear group,

      How do I set the document to a PDF/X standard with the PDFExportPreferences?

      I'm trying to allow the input of bleed with a prompt and have marks and offset follow this (eg. Xmm bleed = Xmm mark offset, and no bleed = no marks). I've found that using a joboptions preset file will overule my bleed/marks/offset settings to those defined in the preset so I've been trying to define all the necessary PDFExportPreferences within the script but can't get the PDF/X standard compliancy part right (unfortunately Adobe sample scripts doesn't cover this) - I would like to export with X-1a compliancy, an output condition and and use the destination (from the UI) "Convert to destination (preserve numbers)". Any tips on the syntax?

      Kind regards,
      Rasmus
        • 1. Re: Setting PDF/X compliancy standard
          Loic.Aigon Adobe Community Professional
          Why not create in the Indesign UI a new preset based on the PDF/X preset will all the parameters you want and then call it the new preset by its name in the script ?
          Also, you can have a look on the Adobe Indesign CS3 scripting guide, there is a large amount of datas about exporting to PDF with all the settings you can specify.
          Loic
          • 2. Re: Setting PDF/X compliancy standard
            Loic.Aigon Adobe Community Professional
            I find this in the ESTK documentation, don't know if it helps

            PDFExportPreference.outputConditionName  
            Data Type: string
            The name of the output condition. Valid only when a PDF/X standard has been defined for the document.

            PDFExportPreference.pdfXProfile  
            Data Type: any
            The PDF X color profile to use for the PDF document. . Can return: PDFProfileSelector enumerator or String.

            PDFXStandards.PDFX1A2001_STANDARD  (Read Only)
            Data Type: number, Value: 1396912481 ('SC1a')
            Checks for compliance with the PDF/X-1a:2001 standard.

            PDFExportPreference.outputCondition  
            Data Type: string
            The name of the intended printing condition. Valid only when a PDF/X compliance standard has been defined for the document. Not valid when PDF/X-3 is the compliance standard or PDF export preset. For information on compliance standards, see standards compliance and PDF X standards.

            Up to you.

            Loic
            • 3. Re: Setting PDF/X compliancy standard
              Level 1
              Hi Loic,

              I have browsed the InDesign object viewer and found the same as you. But as the text states: "Valid only when a PDF/X compliance standard has been defined for the document" - the sample scripts from Adobe has nothing about this, nor have I been able to dig up a thread in this forum or with Google concerning PDF/X and scripting. I really don't know the syntax is supposed to be.

              There are several reason why I want to define my PDF export settings within the script and not reference a joboptions preset: the primary beeing that I'm not allowed to dynamically input bleed/marks/offset values when exporting using a preset file. I'm trying to learn as much as possible about scripting InDesign, and having completely control over the PDFExportPreferences (setting a PDF/X standard) have been no1 on my wishlist for a long time :-)

              Can you help with the syntax - a little example?

              Kind regards,
              Rasmus
              • 4. Re: Setting PDF/X compliancy standard
                sstanleyau Level 4
                On 29/11/08 1:28 AM, "Rasmus Olsen" <member@adobeforums.com> wrote:<br /><br />> There are several reason why I want to define my PDF export settings within<br />> the script and not reference a joboptions preset: the primary beeing that I'm<br />> not allowed to dynamically input bleed/marks/offset values when exporting<br />> using a preset file.<br /><br />Yes you can. Rather than printing using the PDF export settings, you set the<br />active printer preset of the document's printer preferences, modify just the<br />properties you want to change, and then print without specifying PDF export<br />settings in the print command.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>
                • 5. Re: Setting PDF/X compliancy standard
                  Loic.Aigon Adobe Community Professional
                  Can you help with the syntax - a little example?
                  asap
                  • 6. Re: Setting PDF/X compliancy standard
                    sstanleyau Level 4
                    Aargh, I'm confusing printing and PDF export. The best I can think of is to set the properties of PDF export preferences to the properties of the relevant preset, modify the ones you want to change, then export without reference to a preset.
                    • 7. Re: Setting PDF/X compliancy standard
                      Level 1
                      Hi Shane,

                      I believe thats the way it's done, but my problem is that I don't know how to set the PDF/X compliancy standard. Going through the PDF/X presets wasn't of any help.

                      I'm really hoping that Loic will be able to figure out how this is done.
                      • 8. Re: Setting PDF/X compliancy standard
                        Peter Kahrel Adobe Community Professional & MVP
                        It looks as if the enumerations don't work but the numeric value does. This ought to work:
                        >app.pdfExportPreferences.standardsCompliance = PDFXStandards.pdfX1a2001Standard;

                        but it doesn't. This, though, does work:
                        >app.pdfExportPreferences.standardsCompliance = 1396912481;

                        1396912481 corresponds with pdfX1a2001Standard
                        1395745075 corresponds with pdfX1a2003Standard

                        Peter
                        • 9. Re: Setting PDF/X compliancy standard
                          Level 1
                          Here's what you need:

                          >app.pdfExportPreferences.standardsCompliance = PDFXStandards.pdfx1a2001Standard

                          That internal "X" must be lowercase to use this form.

                          When in doubt about the exact mixed case form of the names of the properties of an enumeration object, run this in ESTK and look at the results in the JavaScript Console:
                          var myEnum = PDFXStandards; // change to the enum of interest
                          
                          for (var j in myEnum) {
                            $.writeln(j.toLowerCase().replace(/_(.)/g,
                              function() {return arguments[1].toUpperCase() }));
                          }
                          In this case you get:

                          pdfx1a2001Standard
                          pdfx32002Standard
                          pdfx1a2003Standard
                          pdfx32003Standard
                          pdfx42007Standard

                          Dave

                          PS: Thanks to Peter for the replace code in that little script.
                          • 10. Re: Setting PDF/X compliancy standard
                            Level 1
                            > var myEnum = PDFXStandards; // change to the enum of interest
                            > for (var j in myEnum) {
                            > $.writeln(j.toLowerCase().replace(/_(.)/g,
                            > function() {return arguments[1].toUpperCase() }));
                            > }
                            >

                            Dave, is this in CS3 or CS4? The reason I ask is that PSCS4, there is a bug
                            where iteration over class members like this is busted:

                            (from the ESTKCS4 JS Console)
                            ResampleMethod.NONE
                            Result: ResampleMethod.NONE

                            for (var idx in ResampleMethod) { $.writeln(idx); }
                            Result: undefined


                            A bug report was filed during beta testing but not in time for a fix to get into
                            the final release. I also do not know if it was PS specific or a more general
                            ESTK/CS4/JS interpreter bug. It did make some of my code asplode all over the place.

                            -X
                            • 11. Re: Setting PDF/X compliancy standard
                              Level 1
                              That works when targeting InDesign CS4.

                              By the way, I left out one of the returned values:

                              none

                              Dave
                              • 12. Re: Setting PDF/X compliancy standard
                                Level 1
                                Dave_Saunders@adobeforums.com wrote:
                                > That works when targeting InDesign CS4.

                                That's unexpected. Since it's a core language feature, I would have expected the
                                bug to have occurred across the CS4 product line. I need to test Bridge and see
                                what's going on over there.

                                -X
                                • 13. Re: Setting PDF/X compliancy standard
                                  Harbs. Level 6
                                  About enumerations...

                                  I've had very mixed results using enumerations in CS4. Sometimes they
                                  work, and sometimes not. (I sporadically get "undefined" errors.) I have
                                  not yet figured out any rhyme or reason. I have switched to numeric
                                  values any time I have trouble...

                                  --
                                  Harbs
                                  http://www.in-tools.com
                                  • 14. Re: Setting PDF/X compliancy standard
                                    Level 1
                                    Dear all,

                                    This is what I've learned so far creating a custom PDF/X export setting:

                                    with (app.colorSettings)
                                    {
                                    enableColorManagement = true;
                                    //This wont work on my Mac workstation. Setting the subsequent
                                    //CMS parameters will change the InDesign ColorSettings to "Custom".
                                    //My idea was to create a named preset through the script.
                                    //cmsSettingsPath = "/some path/";
                                    //cmsSettings = "some preset";
                                    rgbPolicy = ColorSettingsPolicy.convertToWorkingSpace;
                                    cmykPolicy = ColorSettingsPolicy.combinationOfPreserveAndSafeCmyk; // 1129345124: combinationOfPreserveAndSafeCmyk
                                    workingSpaceRGB = "Adobe RGB (1998)";
                                    workingSpaceCMYK = "ISOnewspaper26v4";
                                    engine = "Adobe (ACE)";
                                    intent = DefaultRenderingIntent.relativeColorimetric; //1380545123: relativeColorimetric
                                    useBPC = true;
                                    mismatchAskWhenOpening = false;
                                    mismatchAskWhenPasting = false;
                                    mismatchAskWhenOpening = false;
                                    }


                                    Embedding and using a CMYK policy on a document level:

                                    with(app.activeDocument) {
                                    cmykPolicy = colorSettingsPolicy.combinationOfPreserveAndSafeCmyk; // 1129345124: combinationOfPreserveAndSafeCmyk
                                    cmykProfile = "ISOnewspaper26v4";
                                    }


                                    The custom export setting:

                                    with(app.pdfExportPreferences) {
                                    //PDF output options
                                    standardsCompliance = PDFXStandards.pdfx1a2001Standard; //1396912481: pdfx1a2001Standard; 1396922419: pdfx32002Standard
                                    pdfColorSpace = PDFColorSpace.cmyk; //1129142603: cmyk
                                    //outputCondition = "outputCondition"; //this is not working?
                                    //outputConditionName = "outputConditionName"; //use this instead
                                    //alert("effectiveOutputCondition: "+effectiveOutputCondition);
                                    //ocRegistry = "http://somesite";
                                    //alert("effectiveOCRegistry: "+effectiveOCRegistry);
                                    pdfDestinationProfile = PDFProfileSelector.working; //1967419235: useDocument; 1466921579: working
                                    //alert("effectivePDFXProfile: "+effectivePDFXProfile);
                                    }


                                    Be aware that InDesign apparently cache some of these settings even when quitting the app? A forced reset (trashing the prefs files or hitting the key-combo when starting) will solve this temporarily.
                                    • 15. Re: Setting PDF/X compliancy standard
                                      Level 1
                                      Oh, and disabling the Missing Profiles dialogue won't work:
                                      app.colorSettings.mismatchAskWhenOpening = false;

                                      Its strange because the two other Profile mismatch dialogues can be disabled.
                                      • 16. Re: Setting PDF/X compliancy standard
                                        Level 1
                                        Don't believe that - copy/pasting can be dangerous :-)

                                        missingAskWhenOpening = false