• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Script to Export Multiple PDFs at Once

Community Beginner ,
Apr 19, 2018 Apr 19, 2018

Copy link to clipboard

Copied

Hi All

I’m trying to find out how to export two PDF's at once from Indesign CC. I'm aiming to get 1 PDFx-1a PDF (High res with crop and bleed) and 1 smallest File Size (Cropped, no marks)? Could you point me in the right direction or if anyone has a working script I could use that would be amazing. My brain is going to fall out my ears.

Many thanks

Rahul

TOPICS
Scripting

Views

12.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 05, 2019 Nov 05, 2019

Copy link to clipboard

Copied

Anyway to add to the script so that I can identify which page numbers I would like to print? The current script runs the entire document. IE: We save all the business cards for Company X into one file. When someone submits a business card order, we export the one name to pdf. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2020 Apr 16, 2020

Copy link to clipboard

Copied

The script works well to generate pdf-files.
But is it possible to create a jpeg within this script?
I need to create the following several times on a day of 1 InDesign document:
1 HiresPDF
1 Lowres pdf
1 jpeg
For the PDF files, the script works perfectly. But I also want to get a Jpeg file from my InDesign in the same script.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

I'm no code monkey (below script is found on the interwebz), but add this to the end of the script to get a jpg:

 

var doc = app.activeDocument;

// Set JPEG export preferences
app.jpegExportPreferences.properties = {
   antiAlias: true,
   embedColorProfile: true,
   exportResolution: 72,
   // exportingSpread: true, // Uncomment if spreads
   jpegColorSpace: JpegColorSpaceEnum.rgb,
   jpegExportRange: ExportRangeOrAllPages.exportRange,
   jpegQuality: JPEGOptionsQuality.maximum,
   jpegRenderingStyle: JPEGOptionsFormat.baselineEncoding,
   useDocumentBleeds: false,
   simulateOverprint: false,
   pageString: "1" // Page(s) to export, must be a string
}

// Make a temporary file
var tempFile = File("E:/Dokumentexport/temp.jpg");

// Export an image of the page to disk
doc.exportFile(ExportFormat.jpg, tempFile);

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 23, 2018 Apr 23, 2018

Copy link to clipboard

Copied

Thanks guys - Ariel your right I couldn't figure out the bit where I wanted to customise it.

Many thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 26, 2018 Apr 26, 2018

Copy link to clipboard

Copied

I hope this change in script will help you

d = app.activeDocument; preset1 = app.pdfExportPresets.itemByName("[PDF/X-1a:2001]"); preset2 = app.pdfExportPresets.itemByName("[Smallest File Size]"); if (!(preset1.isValid && preset2.isValid)) { alert("One of the presets does not exist. Please check spelling carefully."); exit(); } if (d.saved) { thePath = String(d.fullName).replace(/\..+$/, "") + ".pdf"; thePath = String(new File(thePath).saveDlg()); } else { thePath = String((new File).saveDlg()); } thePath = thePath.replace(/\.pdf$/, ""); name1 = thePath + "_LR.pdf"; name2 = thePath + "_HR.pdf" d.exportFile(ExportFormat.PDF_TYPE, new File(name1), false, preset1); d.exportFile(ExportFormat.PDF_TYPE, new File(name2), false, preset2);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2020 Apr 16, 2020

Copy link to clipboard

Copied

Hi Kepano70,

you say:

 

The script works well to generate pdf-files.
But is it possible to create a jpeg within this script?
I need to create the following several times on a day of 1 InDesign document:
1 HiresPDF
1 Lowres pdf
1 jpeg
For the PDF files, the script works perfectly. But I also want to get a Jpeg file from my InDesign in the same script.

 

Look into Peter Kahrel's Batch Process script where you can save settings:

Batch-process (convert/export/import) documents

https://creativepro.com/files/kahrel/indesign/batch_convert.html

 

Regards,
Uwe Laubender

( ACP )

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines