Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Security for PDF

New Here ,
Sep 24, 2015 Sep 24, 2015

Hi !

I want to ad a security for the PDF I creat with my Export script.

You can open the PDF, print it, put no edit it with InDesign or Illustrator etc...

Can you help me please ?

Thank you

TOPICS
Scripting
810
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Sep 24, 2015 Sep 24, 2015

See here and search for the word security

Adobe InDesign CS5 (7.0) Object Model JS: PDFExportPreference

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 25, 2015 Sep 25, 2015

I've try to use it... but whitout succed 😕

Can you tell me how to use it correctly ?

Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 25, 2015 Sep 25, 2015

Try this ...

var myPDF = new File('~/desktop/foo3.pdf');

with (app.pdfExportPreferences)

{

    pageRange = PageRange.ALL_PAGES;

    useSecurity = true;

    disallowChanging = true;

    disallowCopying = true

    disallowDocumentAssembly = true;

    disallowExtractionForAccessibility = true;

    disallowFormFillIn = true;

    disallowHiResPrinting = true;

    disallowNotes = true;

    disallowPlaintextMetadata = true;

    disallowPrinting = false;

}

app.activeDocument.exportFile(ExportFormat.pdfType, myPDF, false);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 28, 2015 Sep 28, 2015

Where i place it ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Sep 28, 2015 Sep 28, 2015

Look the snippet ...

1°) change PDF Export preferences

2°) export PDF

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 30, 2015 Sep 30, 2015

Hi, now it's different, I want to put this same option but, only when the computeur is not connected to my serveur.

So, when you are in the serveur, you can do what you want with the PDF, ans when you're not, you can juste open, copy and print it.

It's urgent, help me please

Thank you

That's my actual code :


 

app.activeDocument.dataMergeProperties.mergeRecords();    

var myDocument = app.activeDocument;   

main();   

function main(){   

exportPDF();   

function exportPDF(){ 

var myPageName, myFilePath, myFile;  

var myPDFExportPreset = app.pdfExportPresets.item("[Qualité supérieure]"); 

for(var myCounter = 0; myCounter < myDocument.pages.length; myCounter++){    

myPageName = myDocument.pages.item(myCounter).name;  

app.pdfExportPreferences.pageRange = myPageName;  

var myRegExp = /:/gi; 

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

myFilePath = "//TE-srv/hrx/02_JUY_CDSC" + "/" + extractPAFname(myCounter) + ".pdf";   

myFile = new File(myFilePath);   

if(!myFile.exists){ 

myDocument.exportFile(ExportFormat.pdfType, myFile, false, myPDFExportPreset); 

}else{ 

var mConfirm= confirm ('Le document ' + extractPAFname(myCounter) + ' existe déjà, voulez-vous le remplacer ?', 'Document existant'); 

if (mConfirm){ 

myDocument.exportFile(ExportFormat.pdfType, myFile, false, myPDFExportPreset); 

     } 

          }  

               } 

function extractPAFname(AllPages){ 

var myStyle = myDocument.paragraphStyles.itemByName('nom_fichier');    

if (myStyle.isValid){ 

app.findGrepPreferences = app.changeGrepPreferences = null;  

app.findGrepPreferences.appliedParagraphStyle = myStyle;

var mySearch = myDocument.findGrep(); 

if (mySearch.length >0){  

return mySearch[AllPages].contents  

}else { 

alert('Erreur - Pas de texte'); 

exit();    

}    

}else { 

alert('Erreur - Pas de style'); 

exit(); 

}  

     } 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 30, 2015 Sep 30, 2015

So, when you are in the serveur, you can do what you want with the PDF, ans when you're not, you can juste open, copy and print it.

That's not how the PDF security options work. They are stored inside the file, and it does not matter where the file is stored.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 30, 2015 Sep 30, 2015
LATEST

I think I don't used the correct word sorry

It's not possible to protect the file when an user outside the network use it, if this user is not in the network, I can just open, copy and print it.

That's possible ?

Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines