13 Replies Latest reply on Jan 13, 2016 11:56 PM by GoSv

    Is it possible to export 1 design to different PDF with different profiles?

    GoSv Level 1

      When I have made a design, I would like to export it to different PDF's for different purposes:

      - 1 for PRINT

      - 1 for PRESS

      - 1 for WEB

      All have different export pdf settings of course.

      And different locations.

       

      I could do this manually, but could it be possible to have a script doing this? Perhaps with Apple script?

        • 2. Re: Is it possible to export 1 design to different PDF with different profiles?
          winterm Level 4

          simple three-liner:

          app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;

          app.pdfExportPreferences.viewPDF = false;

          app.activeDocument.exportFile(ExportFormat.pdfType, File("C:/Folder/Filename.pdf"), false, "PDF Export preset name");

           

          Repeat this block as many times as you need.

          Just adjust your file path, name, and pdf export preset name (all in 3rd line).

          • 3. Re: Is it possible to export 1 design to different PDF with different profiles?
            GoSv Level 1

            Thank you ! I'm learning some new stuff here !

             

            Is this Applescript or JS?

             

            I'm on mac.

            The path should be relative to the indd file folder. Is this possible?

            • 4. Re: Is it possible to export 1 design to different PDF with different profiles?
              rob day Adobe Community Professional & MVP

              Winterm's code is Javascript, You would have to edit it in TextEdit and save with the .jsx suffix.

               

              If you don't want to manually edit the file paths and pdf names, this AppleScript might work. The first line is a list of the presets you want to export—the names have to be between quotes and separated by commas. Paste into Script Editor (not Text Edit) and save to your ID Scripts folder. The 3 PDFs are saved to the ID file's folder.

               

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

               

              set prelist to {"[High Quality Print]", "[PDF/X-1a:2001]", "[PDF/X-4:2008]"}

              tell application "Adobe InDesign CC 2014"

                  set p to file path of active document

                  set n to name of active document

                  set n to characters 1 thru -6 of n as string

                   set page range of PDF export preferences to all pages

                  set view PDF of PDF export preferences to false

                  repeat with x from 1 to count of prelist

                      set theName to n & "-" & x & ".pdf"

                      set thePath to p & theName as string

                      export document 1 format PDF type to thePath using PDF export preset x

                  end repeat  

              end tell

              • 5. Re: Is it possible to export 1 design to different PDF with different profiles?
                GoSv Level 1

                Thx !

                I got the first javascript working correctly

                Only problem is the folder structure.

                It now saves under /Volumes

                 

                But should save in a folder above the indd file.

                And if possible the same name as the indesign file + quality label

                ex.

                folder1/design.indd

                folder2/HR/design-HR.pdf

                folder2/LR/design-LR.pdf

                folder2/PR/design-PR.pdf

                • 6. Re: Is it possible to export 1 design to different PDF with different profiles?
                  rob day Adobe Community Professional & MVP

                  Only problem is the folder structure.

                  Right, the AppleScript saves the PDFs into the InDesign file's folder—you don't have to hard code the file paths

                  • 7. Re: Is it possible to export 1 design to different PDF with different profiles?
                    GoSv Level 1

                    Now I see !!! Works ok

                    I try to find a way to:

                    - safe to a folder next to the original

                    • 8. Re: Is it possible to export 1 design to different PDF with different profiles?
                      rob day Adobe Community Professional & MVP

                      If you want the exported PDFs to be named with the preset as a suffix—for example YourIDFileName_[High Quality Print].pdf—this might work:

                       

                       

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

                      --exports to these 3 default presets, edit as needed.

                      set prelist to {"[High Quality Print]", "[PDF/X-1a:2001]", "[PDF/X-4:2008]"}

                       

                      tell application "Adobe InDesign CC 2014"

                          set p to file path of active document

                          set n to name of active document

                          set n to characters 1 thru -6 of n as string

                          set view PDF of PDF export preferences to false

                          repeat with x in prelist

                              set pn to my checkIllegal(x)

                              set theName to n & "_" & pn & ".pdf"

                              set thePath to p & theName as string

                              export document 1 format PDF type to thePath using PDF export preset x

                          end repeat

                      end tell

                       

                      --make sure pdf name doesn't contain illegal characters

                      on checkIllegal(s)

                          set AppleScript's text item delimiters to ":"

                          set i to every text item of s

                          set AppleScript's text item delimiters to ""

                          set s to i as string

                          set AppleScript's text item delimiters to "/"

                          set i to every text item of s

                          set AppleScript's text item delimiters to ""

                          set s to i as string

                          return s

                      end checkIllegal

                      • 9. Re: Is it possible to export 1 design to different PDF with different profiles?
                        GoSv Level 1

                        Thx Man, Any idea how I can save to a folder on top of this one?

                        • 10. Re: Is it possible to export 1 design to different PDF with different profiles?
                          rob day Adobe Community Professional & MVP

                          Just keep in mind the parent folder needs write permissions or you will get an error:

                           

                          set prelist to {"[High Quality Print]", "[PDF/X-1a:2001]", "[PDF/X-4:2008]"}

                           

                          tell application "Adobe InDesign CC 2014"

                              set p to file path of active document

                              tell application "Finder"

                                  set pf to parent of folder p as string

                              end tell

                              set n to name of active document

                              set n to characters 1 thru -6 of n as string

                              set view PDF of PDF export preferences to false

                              repeat with x in prelist

                                  set pn to my checkIllegal(x)

                                  set theName to n & "_" & pn & ".pdf"

                                  set thePath to pf & theName as string

                                  export document 1 format PDF type to thePath using PDF export preset x

                              end repeat

                          end tell

                           

                          --make sure pdf name doesn't contain illegal characters

                          on checkIllegal(s)

                              set AppleScript's text item delimiters to ":"

                              set i to every text item of s

                              set AppleScript's text item delimiters to ""

                              set s to i as string

                              set AppleScript's text item delimiters to "/"

                              set i to every text item of s

                              set AppleScript's text item delimiters to ""

                              set s to i as string

                              return s

                          end checkIllegal

                          • 11. Re: Is it possible to export 1 design to different PDF with different profiles?
                            GoSv Level 1

                            it gives an error, it takes the file name with it as path?

                             

                            error "Adobe InDesign CC 2015 kreeg een fout: Cannot find the folder “\"shares:server:Project_2015:Internal:design:design.pdf\"”." number 258


                            This is my adapted version:


                             

                            set prelist to {"[High Quality Print]", "[PDF/X-1a:2001]", "[PDF/X-4:2008]"}

                            tell application "Adobe InDesign CC 2015"

                             

                              set p to file path of active document

                              tell application "Finder"

                              set pf to parent of folder p as string

                              end tell

                             

                              set n to name of active document

                              set n to characters 1 thru -6 of n as string

                              set page range of PDF export preferences to all pages

                              set view PDF of PDF export preferences to true

                             

                             

                              set theName to n & "-" & "HR DRUK.pdf"

                              set thePath to pf & theName as string

                            export document 1 format PDF type to thePath using PDF export preset "DRUKWERK cmyk - snijtekens"

                             

                              set theName to n & "-" & "HR PRINT.pdf"

                              set thePath to pf & theName as string

                            export document 1 format PDF type to thePath using PDF export preset "DRUKWERK cmyk - geen snijtekens"

                             

                              set theName to n & "-" & "LR WEB.pdf"

                              set thePath to pf & theName as string

                            export document 1 format PDF type to thePath using PDF export preset "LORES cmyk"

                            end tell

                            • 12. Re: Is it possible to export 1 design to different PDF with different profiles?
                              rob day Adobe Community Professional & MVP

                              The error is probably because your folder is on a server—you might not have permission to write to the parent of the server folder.

                               

                              Try my script unchanged from a local folder. If you put a test InDesign file in a folder on your desktop, open the file and run my script you should get 3 PDFs on the desktop outside of your folder. I'm not testing for permissions or the existence of a parent folder in the script.

                              • 13. Re: Is it possible to export 1 design to different PDF with different profiles?
                                GoSv Level 1

                                Thx,

                                Yes it's on a server, I get an error wich clearly shows the path, so it's probably permission.

                                Thx for your kind help !