addWatermarkFromFile
- nHorizAlign を上手く調整すれば、複数ページを1枚に集約する手段として使えるかもしれない。
(() => {
const doc = this;
const folderPath
= "/C/Users/username/Desktop/新しいフォルダー/";
const fileNames = [
"添付資料1 A4サイズ縦1枚.pdf",
"添付資料2 A4サイズ縦1枚.pdf",
"添付資料3 A4サイズ縦1枚.pdf",
"添付資料4 A4サイズ縦1枚.pdf",
"添付資料5 A4サイズ縦1枚.pdf"
];
const pageNum1Baseds = [1];
fileNames.forEach( (fileName, i) => {
const filePath = folderPath + fileName;
pageNum1Baseds.forEach( (_null, j, pageNums) => {
doc.addWatermarkFromFile({
cDIPath: filePath,
nSourcePage: 0 + (pageNums[j] - 1),
nStart: i + j,
nEnd: i + j,
bOnTop: true,
bOnScreen: true,
bOnPrint: true,
nHorizAlign: app.constants.align.left,
nVertAlign: app.constants.align.center,
nHorizValue: Math.round((72/25.4) * 0),
nVertValue: Math.round((72/25.4) * 0),
bPercentage: false,
nScale: 1.0,
bFixedPrint: false,
nRotation: 0,
nOpacity: 1.0
});
});
});
})();
insertPages
(() => {
const dstDoc = this;
const srcDocNumPages = 5;
var i;
for (i = 0; i < srcDocNumPages; i++) {
dstDoc.insertPages({
nPage: 2 * i,
cPath: "/C/Users/username/Desktop/別の文書.pdf",
nStart: i,
nEnd: i
});
}
})();