文章目录
1.算法程序
- 1.算法程序
- 2.作者答疑
Adobe InDesign是Adobe公司的一个桌面出版 (DTP) 的应用程序,主要用于各种印刷品的排版编辑。InDesign可以将文档直接导出为Adobe的PDF格式,而且有多语言支持。采用脚本语言自动化编码,在学习中的一个重要功能是多页PDF导入功能,以下源代码仅用于学习交流,请勿用于商业用途和其它非法用途。源代码如下所示:
//PlacePDFPages.js
//Select the file you want to place.
var myFile = File.openDialog("Select the file you want to place", "");
//Create a dialog.
var myDialog = app.dialogs.add({name:"PDF多页面导入",canCancel:true});
with(myDialog){
//Add a dialog column.
with(dialogColumns.add()){
//Create First border panel.
with(borderPanels.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"导入PDF从第1页到第n页:"});
}
with(dialogColumns.add()){
//Create a number entry field.Note that this uses editvalue
//rather than editerText (as a textBox would).
var LastPagesNumField = realEditboxes.add({editValue:5});
}
}
//Create Second border panel.
with(borderPanels.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"PDF页面左上角定位于X坐标(mm):"});
}
with(dialogColumns.add()){
//Create a number entry field.Note that this uses editvalue
//rather than editerText (as a textBox would).
var TopLeftXField = realEditboxes.add({editValue:0});
}
}
//Create Third border panel.
with(borderPanels.add()){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"PDF页面左上角定位于Y坐标(mm):"});
}
with(dialogColumns.add()){
//Create a number entry field.Note that this uses editvalue
//rather than editerText (as a textBox would).
var TopLeftYField = realEditboxes.add({editValue:0});
}
}
}
}
//Display the dialog box.
if(myDialog.show() == true){
//Get the LastPagesNum from the LastPagesNumField.
LastPagesNum = LastPagesNumField.editValue;
TopLeftX=TopLeftXField.editValue;
TopLeftY=TopLeftYField.editValue;
var myDocument = app.activeDocument;
myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.millimeters;
myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.millimeters;
Locat = [TopLeftX, TopLeftY];
app.pdfPlacePreferences.pdfCrop=PDFCrop.cropMedia;
myDocument.documentPreferences.pagesPerDocument = LastPagesNum;
for (i=0; i
关注
打赏
热门博文
- Adobe illustrator插件开发-SPInterfaceSuite-插件A向插件B传递消息-插件通信-AI插件开发
- javascript-ztree-树形控件-初始化-加载节点数据-节点数据获取
- Adobe illustrator插件开发-坐标系统-AIHardSoftSuite-画板坐标-页面坐标-AI插件开发
- Adobe illustrator插件开发-AIUIDUtilsSuite-AIUIDPoolSuite-AIUIDSuite-AIUIDREFSuite-Art唯一标识符与索引-AI插件开发
- C++-逆向分析-类的成员函数地址与对象地址动态绑定-this指针-成员函数和成员虚函数反汇编解析
- C++-逆向分析-结构体和类-内存布局-this指针-静态数据成员-对象作为参数和返回值
- Adobe illustrator插件开发-命令名称-AddCommand -AI插件开发
- Adobe illustrator插件开发-事件-PlugPlugAddEventListener-向系统注册事件-AI插件开发
- Adobe illustrator插件开发-ole拖拽粘贴交换数据格式-RegisterClipboardFormat函数-AI插件开发
- Adobe illustrator插件开发-所有模块列表-内部存在大量非公开的Suite-AI插件开发