import pdf into indesign
Hi,
i want to import pdf into indesign through script. That will select the pdf on verso pages alone with supplied input value and align
the pdf accordingly. it should not touch recto page.
verso side values
x-axis 0p2
y-axis 0p1.2
Here i attacehd my script
TopMargin=app.activeDocument.pages[0].marginPreferences.top;
LeftMargin=app.activeDocument.pages[0].marginPreferences.left;
FirstLayer=app.activeDocument.layers[0];
var OriginPoint=new Array();
OriginPoint[0]=TopMargin;
OriginPoint[1]=LeftMargin;
myInDesign=app;
myDocument=app.activeDocument;
myFileName=File.openDialog("Choose a PDF File");
if(myFileName == null){
alert("Select a PDF file to Import!");
}
myInDesign.pdfPlacePreferences.pdfCrop = PDFCrop.cropContent;
myCounter = 0;
pg=0;
myBreak = false;
while (myBreak ==false){
if (myCounter > 0){
myDocument.pages.add();
}
PDFpg=pg;
PDFpg++;
app.pdfPlacePreferences.pageNumber =PDFpg;
app.activeDocument.layoutWindows[0].activePage=app.activeDocument.pages[pg];
myPDFPage=app.activeDocument.pages[pg].place(myFileName,OriginPoint);
alert(myCounter)
alert(myPDFPage)
if(myCounter == 0){
myFirstPage = myPDFPage.pdfAttributes.pageNumber;
}
else{
if (myPDFPage.pdfAttributes.pageNumber ==myFirstPage){
app.activeDocument.pages[pg].remove();
alert("All pages in the pdf document are imported!");
myBreak = true;
}
}
myCounter++;
pg++;
}