Copy link to clipboard
Copied
Hi! i just found this script that allows me to export individual PDF from a book. Can you help me add 3mm crop marks to the script?
I used this script:
/*
Export Book As Individual PDFs
by m1b, posted here: https://community.adobe.com/t5/indesign-discussions/how-to-export-separate-pdf-files-from-a-book-but...
*/
function main() {
exportBookAsIndividualPDFs({
// 2-number array of 1-based document numbers
// range: undefined, will export all documents of book
// range: [1, 4], exports only the first 4 documents of book
range: undefined,
// name of folder to export pdfs into
// will be created if it doesn't exist
// folder is in same folder as book
folderName: 'PDFs',
// the PDF preset name
PDFPresetName: '[Press Quality]'
});
function exportBookAsIndividualPDFs(params) {
var range = params.range,
folderName = params.folderName,
presetName = params.PDFPresetName;
folderName = folderName || 'PDFs';
PDFPresetName = presetName || '[Press Quality]';
try {
var myPDFExportPreset = app.pdfExportPresets.itemByName(PDFPresetName)
if (!myPDFExportPreset.isValid)
throw 'PDF Preset "' + PDFPresetName + '" is not valid.';
if (app.books.length == 0)
throw 'No books currently open.'
var book = app.books[0],
exportPath = book.filePath + '/' + folderName + '/',
exportFolder = new Folder(exportPath);
// prepare the document range, if specified
if (range == undefined || range.length != 2)
range = [1, book.bookContents.length];
// get the book contents
var bkContents = book.bookContents.itemByRange(range[0] - 1, range[1] - 1);
if (bkContents.constructor.name != 'BookContent')
throw 'Could not get book content for range ' + range + '.'
// this gets file references
var exportDocs = bkContents.fullName;
// set up folder
if (!exportFolder.exists)
exportFolder.create();
// export each document
var i;
for (i = 0, r = range[0] - 1; r < range[1]; i++, r++) {
var doc = exportDocs[i],
filename = doc.name.replace(/\.indd$/, '.pdf'),
exportFile = File(exportPath + filename);
// export
book.exportFile(
ExportFormat.PDF_TYPE,
exportFile,
false,
myPDFExportPreset,
[book.bookContents.item(r)]
);
}
// done
alert(i + ' PDFs exported.');
// reveal folder
exportFile.parent.execute();
} catch (error) {
alert('Export failed\n' + error);
}
}
} // end main
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Export Book As Individual PDFs');
Copy link to clipboard
Copied
//To your myPDFExportPreset you need to add:
myPDFExportPreset.cropMarks = true;
//if you had set the bleed in the file,
myPDFExportPreset.useDocumentBleedWithPDF = true;
//this should be the same size as your bleed,
myPDFExportPreset.pageMarksOffset = "3mm";
If you wanted to make the actual crop marks a length of 3mm and not spaced out 3mm, it get complicated. The size of Indesign crop marks is 0.208" or 5.2832mm. To make crop marks of a different size you would have to increase the size of every page by 6mm x 6mm and would have to have the program draw in the lines on every page.
Copy link to clipboard
Copied