var myPDFFile = File.openDialog("Choose a PDF File", "PDF files:*.PDF");
if(myPDFFile == "" || myPDFFile == null)
exit(0);
myDocument = app.documents.add();
myPage = myDocument.pages.item(0);
myPlacePDF(myDocument, myPage, myPDFFile);
w = (myDocument.allGraphics[0].geometricBounds[2]) - (myDocument.allGraphics[0].geometricBounds[0]);
h = (myDocument.allGraphics[0].geometricBounds[3]) - (myDocument.allGraphics[0].geometricBounds[1]);
w = Math.round(w);
h = Math.round(h);
$.writeln (w);
$.writeln (h);
myDocument.close();
function myPlacePDF(myDocument, myPage, myPDFFile){
var myPDFPage =1;
app.pdfPlacePreferences.pdfCrop = PDFCrop.cropMedia;
var myCounter = 1;
var myBreak = false;
myPDFPage = myPage.place(File(myPDFFile), [0,0])[0];
}