3 Replies Latest reply on Aug 4, 2016 12:36 PM by borges61970608

    Place pdf without cropping

    borges61970608

      Hi!

      Anyone out there who knows how to place the whole sheet of pdf files in Indesign without cropping it - and also still maintain the transparancy?

      I work with music sheets, and have designed the page size and margins in the music notation software that it fits directly into the Indesign document.

      It is time saving to place the whole pdf sheet directly over the indesign sheet, instead of having to adjust and work with every pdf (hundreds of them) file.

       

      Please help

       

      Børge

      Norway

        • 1. Re: Place pdf without cropping
          philippanmei Level 4

          you can place your pfd file in indesign using the script.

          First set up your Indesign Master Page according to the PDF document size and Press Ctrl+Alt+F11 to open up the script dialog box in Indesign and choose PlaceMultiplePagePDF.

           

           

           

           

          If you don't find the script then copy the below script and save it.

          //PlaceMultipagePDF.jsx

          //An InDesign JavaScript

          /* 

          @@@BUILDINFO@@@ "PlaceMultipagePDF.jsx" 3.0.0 15 December 2009

          */

          //Places all of the pages of a multi-page PDF.

          //

          //For more on InDesign/InCopy scripting see the documentation included in the Scripting SDK

          //available at http://www.adobe.com/devnet/indesign/sdk.html

          //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com

          //

          main();

          function main(){

            //Make certain that user interaction (display of dialogs, etc.) is turned on.

            app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

            //Display a standard Open File dialog box.

            var myPDFFile = File.openDialog("Choose a PDF File");

            if((myPDFFile != "")&&(myPDFFile != null)){

            var myDocument, myPage;

            if(app.documents.length != 0){

            var myTemp = myChooseDocument();

            myDocument = myTemp[0];

            myNewDocument = myTemp[1];

            }

            else{

            myDocument = app.documents.add();

            myNewDocument = false;

            }

           

            alert(myDocument.constructor.name);

            if(myNewDocument == false){

            myPage = myChoosePage(myDocument);

            }

            else{

            myPage = myDocument.pages.item(0);

            }

            myPlacePDF(myDocument, myPage, myPDFFile);

            }

          }

          function myChooseDocument(){

              var myDocumentNames = new Array;

              myDocumentNames.push("New Document");

              //Get the names of the documents

              for(var myDocumentCounter = 0;myDocumentCounter < app.documents.length; myDocumentCounter++){

                  myDocumentNames.push(app.documents.item(myDocumentCounter).name);

              }

              var myChooseDocumentDialog = app.dialogs.add({name:"Choose a Document", canCancel:false});

              with(myChooseDocumentDialog.dialogColumns.add()){

                  with(dialogRows.add()){

                      with(dialogColumns.add()){

                          staticTexts.add({staticLabel:"Place PDF in:"});

                      }

                      with(dialogColumns.add()){

                          var myChooseDocumentDropdown = dropdowns.add({stringList:myDocumentNames, selectedIndex:0});

                      }

                  }

              }

            var myResult = myChooseDocumentDialog.show();

            if(myResult == true){

            if(myChooseDocumentDropdown.selectedIndex == 0){

            myDocument = app.documents.add();

            myNewDocument = true;

            }

            else{

            myDocument = app.documents.item(myChooseDocumentDropdown.selectedIndex-1);

            myNewDocument = false;

            }

            myChooseDocumentDialog.destroy();

            }

            else{

            myDocument = "";

            myNewDocument = "";

            myChooseDocumentDialog.destroy();

            }

              return [myDocument, myNewDocument];

          }

          function myChoosePage(myDocument){

            alert(myDocument.name);

              var myPageNames = new Array;

              //Get the names of the pages in the document

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

                  myPageNames.push(myDocument.pages.item(myCounter).name);

              }

              var myChoosePageDialog = app.dialogs.add({name:"Choose a Page", canCancel:false});

              with(myChoosePageDialog.dialogColumns.add()){

                  with(dialogRows.add()){

                      with(dialogColumns.add()){

                          staticTexts.add({staticLabel:"Place PDF on:"});

                      }

                      with(dialogColumns.add()){

                          var myChoosePageDropdown = dropdowns.add({stringList:myPageNames, selectedIndex:0});

                      }

                  }

              }

              myChoosePageDialog.show();

              var myPage = myDocument.pages.item(myChoosePageDropdown.selectedIndex);

              myChoosePageDialog.destroy();

              return myPage;

          }

          function myPlacePDF(myDocument, myPage, myPDFFile){

            var myPDFPage;

            app.pdfPlacePreferences.pdfCrop = PDFCrop.cropMedia;

            var myCounter = 1;

            var myBreak = false;

            while(myBreak == false){

            if(myCounter > 1){

            myPage = myDocument.pages.add(LocationOptions.after, myPage);

            }

            app.pdfPlacePreferences.pageNumber = myCounter;

            myPDFPage = myPage.place(File(myPDFFile), [0,0])[0];

            if(myCounter == 1){

            var myFirstPage = myPDFPage.pdfAttributes.pageNumber;

            }

            else{

            if(myPDFPage.pdfAttributes.pageNumber == myFirstPage){

            myPage.remove();

            myBreak = true;

            }

            }

            myCounter = myCounter + 1;

            }

          }

           

          Thanks

          2 people found this helpful
          • 2. Re: Place pdf without cropping
            Peter Spier Most Valuable Participant (Moderator)

            There is a much better script for placing multipage PDFs at InDesignSecrets » Blog Archive » Zanelli Releases MultiPageImporter for Importing both PDF and INDD Files

             

            Cropping for placed PDF is determined by the option you choose in the import options when placing, so manually place any PDF and click the Show Import Options box, or hold the Shift key when you click OK, then set the Crop option to Media to get the entire page.  This is sticky and will remain  unchanged until you change it while placing another PDF or .ai file.

            • 3. Re: Place pdf without cropping
              borges61970608 Level 1

              Thanks for all help.

              Tried out the script - working wonderful!!

              I was aware of the options to choose when importing. I have also cykled through them without really knowing what each of them did exactly.

              Mostly the choises was greyed out, could though choose "Media" - but still ID cropped the pdf.

              Have worked a bit harder with these options, and for one or another reason, suddenyly ID did not crop the pdf any more.

              And the "Media" option now stays as default. Importing one page without cropping can now be done with one click.

              Here is by other words "double happiness", and I save many, many hours on my path to the finished document!

               

              Thank You for helping.

              Børge

              Norway