10 Replies Latest reply on Apr 10, 2017 12:59 PM by robertm43450875

    Mark frames

    robertm43450875 Level 1

      Hi

       

      I want to export frames (images, texts) using javascript.

      After export i need to mark frames as exported (e.g. border colour, background colour)

       

      Important is that user will see which frame was exported.

       

      And important is that file will be print without marks.

       

      Thanks

        • 1. Re: Mark frames
          Ananth@desgin Level 3

          add a stroke values to the frame

           

          //==== Batch PDF =====\\

           

          /* InDesign JavaScript to Create PDFs of a batch of InDesign files using an export PDF preset */

           

          var myPDFExportPreset = app.pdfExportPresets.item("[High Quality Print]"); // Change myPDFpreset to the name of the preset you want to use

           

          var myFileLocation = Folder.selectDialog("Please select path to files"); // file path selection

           

          myFolder = new Folder ([myFileLocation]);

           

          myFolderContents = myFolder.getFiles("*.indd"); // array

           

          myFileAmount = (myFolderContents.length - 1);

           

          // ===== Open, Export as PDF, and Close files ===== \\ 

           

          for (i = myFileAmount; i >= 0; i--)

           

           

          app.open(File (myFolderContents[i]));

           

          app.activeDocument.exportFile(

           

            ExportFormat.pdfType, 

           

            new File(myFolder.fsName + "/" + app.activeDocument.name.split(".indd")[0] + ".pdf"),

           

            false, 

           

            myPDFExportPreset

           

            );

           

          app.activeDocument.close(SaveOptions.no);

           

          }

           

          Thanks

          Prabu

          • 2. Re: Mark frames
            robertm43450875 Level 1

            I look at this code and i don't knowe where is frame mark.

            I know how to export file but i don't know how to mark frame (e.g selected frames or all frames from file)

            • 3. Re: Mark frames
              Ananth@desgin Level 3

              Hi Rob,

               

              You want display frame to image after exported using JavaScript..?

               

              Thanks

              • 4. Re: Mark frames
                robertm43450875 Level 1

                Yes.

                 

                Export is unimportant. I need to mark frame using javascript. User have to know that frame is marked (frame color, border color)

                But important is that document will be printed without marks.

                • 5. Re: Mark frames
                  Ananth@desgin Level 3

                  Hi,

                   

                  Add a stroke values to the every frames.

                   

                  Below code add the stroke values of the frame border color.

                   

                  var myDoc = app.documents[0];

                  var color = myDoc.colors.add({name:"Stroke", model:ColorModel.PROCESS, space: ColorSpace.CMYK, colorValue:[0, 100, 100, 0]});

                  var frame = myDoc.pageItems.everyItem().getElements();

                  for(i=0; i<frame.length; i++)

                  {

                      frame[i].strokeWeight = "0.5pt";

                       frame[i].strokeColor = "Stroke";

                      }

                   

                  Thanks

                  • 6. Re: Mark frames
                    robertm43450875 Level 1

                    But it will be visible when i print document

                    I know how to change stroke.

                     

                    My english is so bad that you can understand me.

                     

                    I repat once more:

                    Important is that document will be printed without marks.

                    • 7. Re: Mark frames
                      Ananth@desgin Level 3

                      Can you post screenshot..?

                      Thanks

                      • 8. Re: Mark frames
                        robertm43450875 Level 1

                        No because i don't know how to solve this problem.

                         

                        I need mark frame (picture or text)

                        I don't know how to ilustrate situation when mark( for example border) is on the screen but isn't on the printer.

                         

                        Thanks

                        • 9. Re: Mark frames
                          [Jongware] Most Valuable Participant

                          Here is an idea: tag the frames with an XML tag. Tagged frames are not visible by default, but you can make it so with "View > Structure > Show Tagged Frames".

                           

                          The colors on-screen are FYI only, and will not be visible in Preview mode and in an exported PDF.

                           

                          (Beware that tagged text frames work per story, not per frame. Linked frames will always share their tag. If all of your text frames are separate, this won't be a problem.)

                           

                          taggedframe.png

                          • 10. Re: Mark frames
                            robertm43450875 Level 1

                            Thanks

                             

                            But how to do it using javascript