5 Replies Latest reply on Jun 10, 2014 9:20 PM by zerotrickpony

    how to maintain page order in load pdf/save pdf

    Peter J. Veger Level 1

      (Photoshop CS6)

      I want to apply one and the same action to all pages of a pdf-file. The pages have a systematic error, too dark.

      So:

      1. load pdf-file

      2. select all pages

      3. apply action, in my case change level, to all pages

      4. save all pages as pdf-file, in the original page order.

      Thanks,

      Peter J. Veger, Best

        • 1. Re: how to maintain page order in load pdf/save pdf
          HowardPinsky Level 4

          Hi, Peter.

           

          I've stepped away from my computer for a moment, but I believe the following process could work:

           

          Drag your PDF into Photoshop. When the popup appears, select all the pages, and open them.

          Apply the action as a Batch process: File > Automate > Batch. Select your action from the dropdown, then select "Opened Files" as the Source.

          Once the action has been applied to all opened files, you can automate the PDF presentation. File > Automate > PDF Presentation.

          Again, you can use your currently opened files to include in the PDF.

           

          Let us know if this works out. Once I get back to my computer, I'll take a deeper look.

          • 2. Re: how to maintain page order in load pdf/save pdf
            Peter J. Veger Level 1

            I did exactly that before asking the question.

            But, the problem is: the order of the pages is reversed!

            Peter J. Veger, Best NL

            • 3. Re: how to maintain page order in load pdf/save pdf
              Luanne Seymour Adobe Employee

              I'm moving this question to the Photoshop General Discussion forum for specialized attention to your situation.

              • 4. Re: how to maintain page order in load pdf/save pdf
                Paul Riggott Level 6

                You could use this script to save the pdf, as it will reverse the order of the documents....

                 

                 

                #target Photoshop
                app.bringToFront();
                main();
                function main(){
                if(!documents.length) return;
                var win= new Window('dialog');
                win.pnl1 = win.add('panel', undefined, undefined, {borderStyle:"black"}); 
                win.g5 = win.pnl1.add('group');
                win.g5.alignChildren="center";
                win.g5.title = win.g5.add('statictext',undefined,'Save PDF');
                win.g5.title.graphics.font = ScriptUI.newFont("Georgia","BOLDITALIC",20);
                win.g10 = win.pnl1.add('group');
                win.g10.orientation="column";
                win.g10.alignment=["left","fill"];
                win.g10.st1 = win.g10.add('statictext',undefined,'Please enter file name');
                win.g10.st1.helpTip="Do not add the suffix .pdf";
                win.g10.et1 = win.g10.add('edittext');
                win.g10.et1.preferredSize=[250,20];
                win.g10.st2 = win.g10.add('statictext',undefined,'Please select output folder ...');
                win.g15 = win.pnl1.add('group');
                win.g15.orientation="row";
                win.g15.alignment=["left","left"];
                win.g15.et1 = win.g15.add('edittext');
                win.g15.et1.enabled=false;
                win.g15.et1.preferredSize=[250,20];
                win.g15.bu1 = win.g15.add('button',undefined,'Browse');
                win.g15.bu1.onClick = function() {
                  outputFolder = Folder.selectDialog("Please select the output folder"); 
                 if(outputFolder !=null){
                  win.g15.et1.text =  decodeURI(outputFolder.fsName); 
                  }
                }
                win.g100 = win.pnl1.add('group');
                win.g100.orientation="row";
                win.g100.bu1 = win.g100.add('button',undefined,'Save PDF');
                win.g100.bu1.preferredSize=[165,30];
                win.g100.bu2 = win.g100.add('button',undefined,'Cancel');
                win.g100.bu2.preferredSize=[165,30];
                win.g100.bu1.onClick=function(){
                if(win.g10.et1.text == ''){
                    alert("No file name has been entered!");
                    return;
                    }
                if(win.g15.et1.text == ''){
                    alert("No output folder has been selected!");
                    return;
                    }
                win.close(0);
                var Names=[];
                for(var a=0;a<documents.length;a++){
                    Names.push(decodeURI (documents[a].name));
                    }
                Names.reverse();
                var SaveFile = File(outputFolder + "/" + win.g10.et1.text + ".pdf");
                makePDF(Names,SaveFile);
                }
                win.show();
                }
                function makePDF(Names,SaveFile) {
                var desc = new ActionDescriptor();
                var list = new ActionList();
                for(var z in Names){list.putString( Names[z].toString() );}
                desc.putList( charIDToTypeID('flst'), list );
                desc.putPath( charIDToTypeID('T   '), new File( SaveFile ) );
                desc.putBoolean( stringIDToTypeID('includeAnnotations'), true );
                desc.putEnumerated( charIDToTypeID('BckC'), charIDToTypeID('BckC'), charIDToTypeID('Wht ') );
                var desc2 = new ActionDescriptor();
                desc2.putString( stringIDToTypeID('pdfPresetFilename'), "High Quality Print" );
                desc2.putBoolean( stringIDToTypeID('pdfPreserveEditing'), false );
                desc2.putInteger( stringIDToTypeID('pdfCompressionType'), 7 );
                desc.putObject( charIDToTypeID('As  '), charIDToTypeID('PhtP'), desc2 );
                executeAction( stringIDToTypeID('PDFExport'), desc, DialogModes.NO );
                };
                
                
                 
                • 5. Re: how to maintain page order in load pdf/save pdf
                  zerotrickpony

                  I had this same problem. If you go ahead and export it backwards, then you can import the backwards file and export it again. Backwards twice = Forwards. Details:

                   

                  1) File > Open > your PDF file

                  2) Select "pages" to import

                  3) Click page 1

                  4) Scroll to the last page

                  5) Shift-click the last page, to select all pages

                  6) Click "OK"

                  7) Make changes to the pages as desired

                  8) File > Automate > PDF Presentation...

                  9) Check the "Add open files" box

                  10) Click Save

                  11) Set the name to be "backwards.pdf"

                  12) Repeat steps 1 through 10 with the "backwards.pdf" and it will be fixed.

                   

                  Hope that helps!

                  - Z