0 Replies Latest reply on Nov 10, 2009 12:07 PM by tommy_boy56

    PDF Security II

    tommy_boy56 Level 1

      Hello all, I was reading a post about pdf security and the following script, created by Mike Brog, was mentioned. However, I do not know how to modify it to work for me. I am very new to scripting. Some of the elements look familiar to me, but I still do not know what to modify.

       

      I should clarify that I need the script to export a pdf with the security settings already applied.

       

      I have replied to the original post but thought I would get a better response by making a new post.

       

      Thanks Tom

       

       

       

       

      CurrentDoc = app.activeDocument;

      CurrentPage = app.activeWindow.activePage.name;

      myFile = "VOLX:_DNK1:PROOFWATERMARK2.pdf";

       

      var insertedImages = CurrentDoc.pages.item(CurrentPage).place(myFile);

      var myGraphic = CurrentDoc.allGraphics[0];

       

      myGraphic.parent.geometricBounds = ["0p","0p",CurrentDoc.documentPreferences.pageHeight,CurrentDoc.documentPrefere nces.pageWidth]

      myGraphic.fit(FitOptions.proportionally)

      myGraphic.fit(FitOptions.CENTER_CONTENT)

      myGraphic.opacity = 30

       

      with(app.pdfExportPreferences){

      cropMarks = false;

      registrationMarks = false;

      acrobatCompatibility = AcrobatCompatibility.acrobat5;

      colorBitmapCompression = BitmapCompression.autoCompression;

      colorBitmapQuality = CompressionQuality.low;

      colorBitmapSampling = Sampling.bicubicDownsample;

      colorBitmapSamplingDPI = 100;

      compressionType = PDFCompressionType.compressObjects;

      compressTextAndLineArt = true;

      cropImagesToFrames = true;

      grayscaleBitmapCompression = BitmapCompression.autoCompression;

      grayscaleBitmapquality = CompressionQuality.low;

      grayscaleBitmapSampling = Sampling.bicubicDownsample;

      grayscaleBitmapSamplingDPI = 100;

      monochromeBitmapCompression = MonoBitmapCompression.ccit4;

      monochromeBitmapSampling = Sampling.bicubicDownsample;

      monchromeBitmapSamplingDPI = 300;

      optimizePDF = true;

      subsetFontsBelow = 100;

      useSecurity = true;

      viewPDF = true;

      disallowPrinting = false;

      disallowCopying = true;

      disallowChanging = true;

      changeSecurityPassword = "XXXXXX"

      }

       

      var myPageName, myFilePath, myFile;

      var myDocument = app.activeDocument;

      var myDocumentName = myDocument.name;

      var myRegExp = new RegExp(":","gi");

      var myRegExp2 = new RegExp(".indd","gi");

       

      myPageName = myDocument.name

      myPageName = myPageName.replace(myRegExp, "_");

      myBaseName = myPageName.replace(myRegExp2, "");

      myFilePath = "VOL1:Test PDF Ads:_LOW RES PROOF - WATERMARK:" + myBaseName + ".pdf";

      myFile = new File(myFilePath);

       

      CurrentDoc.exportFile(ExportFormat.pdfType, myFile, false)