How can I auto export a PDF File using the "Smallest File Size" preset and set the Exported File Name based on information from an Imported PDF?
Greetings all,
I am trying to create a script to automate a PDF export process for my company for inDesign. I’m fairly new to inDesign itself and have no previous experience with javascript, although I did take C++ in high school and have found it helpful in putting this code together.
We have an inDesign template file and then use the Multi-page PDF importer script to import PDF files. We then have to export two version of each file that we import, then delete the imported file and all of the pages to reset the template. This has to be done for nearly 1000 pdf files each month and is quite tedious. I’m working on automating the process as much as possible. I’ve managed to piece together code that will cleanup the file much quicker and am now trying to automate the PDF exports themselves.
The files are sent to us as “TRUGLY#####_Client” and need to be exported as “POP#####_Client_Date-Range_North/South.pdf”
For example, TRUGLY12345_Client needs to be exported as POP12345_Client_Mar01-Mar31_North and POP12345_Client_Mar01-Mar31_South.
There are two templates built into the template file for the north and south file that are toggled easily via layer visibility switches. I need to get a code that can ideally read the #s from the imported Trugly file as well as the Client and input those into variables to use when exporting. The date range is found in the same place in the top right of each pdf file. I am not sure if this can be read somehow or if it will have to be input manually. I can put North or South into the file name based on which template layer is visible.
I am not sure how to go about doing this. I did find the following code for exporting to PDF with preset but it requires me to select a preset and then type the full file name. How can I set it to automatically use the “Smallest File Size” preset without prompting me to choose and then automatically input some or preferably all of the file name automatically? (If the entire filename is possible then I don’t even want a prompt to appear so it will be fully automated!)
PDF Export Code (Originally from here: Simple PDF Export with Preset selection | IndiSnip [InDesign® Snippets]):
var myPresets = app.pdfExportPresets.everyItem().name;
myPresets.unshift("- Select Preset -");
var myWin = new Window('dialog', 'PDF Export Presets');
myWin.orientation = 'row';
with(myWin){
myWin.sText = add('statictext', undefined, 'Select PDF Export preset:');
myWin.myPDFExport = add('dropdownlist',undefined,undefined,{items:myPresets});
myWin.myPDFExport.selection = 0;
myWin.btnOK = add('button', undefined, 'OK');
myWin.center();
var myWindow = myWin.show();
if(myWindow == true && myWin.myPDFExport.selection.index != 0){
var myPreset = app.pdfExportPresets.item(String(myWin.myPDFExport.selection));
myFile = File(File.saveDialog("Save file with preset: " + myPreset.name,"PDF files: *.pdf"));
if(myFile != null){
app.activeDocument.exportFile(ExportFormat.PDF_TYPE, myFile, false, myPreset);
}else{
alert("No File selected");
}else{
alert("No PDF Preset selected");
So far my code does the following:
1) Runs the Multi-Page PDF Import Script
2) Runs PDF Export Script Above
3) Toggles the Template
4) Runs #2 Again
5) Deletes the imported PDF and all pages and toggles template again.
It’s close and much better than the original process which was almost 100% manual but I’d like to remove the Preset prompt from the PDF script and have it automatically select the “Smallest File Size” preset. and then if there’s a way to have it auto-fill in the file name so no user input is required at all other than selecting each file to import. (If there’s a way to setup a batch action for the multi-import script that would be even better!)
Thanks in advance and if there’s anything else I can provide that would help please let me know! Even a nudge in the right direction will be a big help!
If you hold down the option key, it will typically show the location. Or you can often hit option-return on the file and it will reveal the file in the Finder, instead of opening it.
Final option is to open it, and just option-click the filename in the toolbar of Preview and it should show you the location.
It's probably an attachment to an email you've received. If you have Mail set to cache emails and their attachments it'll be stashed in a subdirectory of ~/Library/Mail. Which is fine.
Similar Messages
-
How can I synchronize my iPhoto events? my iTunes doesn't read them and with the app Images in the iPad I can only find Photos, Albums, Faces and Places, not Events.
I had a problem a couple of months ago when iPhotos suddenly rearranged the order of my Events (Why won't iPhoto let me arrange my photos?) . I was told "Use albums not events - events are not a good way to organize - albums and folder are designed for organisation and are very flexible".
Haha! I should have paid attention and read between the lines! My iPhotos were highly organised groupings - not according to date but the way I wanted them - and it was so easy to do! I see now that if I had them all in albums, as per the Apple Apologist suggestion, I wouldn't have this unholy mess I have been left with just to make iPhone & iCloud users happy. I am now going through Photos and making Albums (of what used to be in my Events) ... maybe I'll get this finished before they do another non user friendly update! -
how can i hightlight in excel 3 numbers in a column then skip one, and highlight the next?
Example: Column A
highlight 3
highlight 4
highlight 5
skip 6
highlight 7hold down the cmd (⌘) key while selecting them.
-
How can one convert a picture to 1080 pixels in height at 72 dpi and retain the aspect ratio?
How can one convert a picture to 1080 pixels in height at 72 dpi and retain the aspect ratio?
The ppi has nothing to do with this. It will stay at whatever it is.
Go to image>resize>resize image, turn ON Resample image and enter 1080 for the height, making sure to leave constrain proportions turned on. Don't mess with the ppi setting.
If the image is set to another ppi setting, then after you're done with the above, go back into that window, turn OFF resample image, and set the ppi to 72. PPI only affects the inc/cm measurement. -
I have a white 17' flat panel g5 imac power pc, I recently bought used. It had OS 10.5.8. Due to a storm the hard drive was damaged and I replace with new hd.
I did not get a system disc or other support discs with the machine. How or where can I find or download a new-install version of OS 10.5 or up to 10.5.8 that will work with the PPC? Thanks.Call the Apple Store and ask them to sell you a copy, you can then use the combo updater or you can buy a copy on eBay, but make sure it's the black retail copy and not a grey machine specific disc.
-
How can I dial to a phone number using land line, internal PC modem and LabVIEW 8.2
I will start to write a LabVIEW 8.2.1 program which dial to a phone number using my Dell Inspiron, Windows XP. Does any body have an idea how can I do it? or better if any body have a vi ready.
I will appreciate your help
Thanks in advance
Solved!
Go to Solution.The link Somil provided is very good.
Neddless to say that you need a modem. And the modem's user or programmer's guide.
Most modems have the same command structure, however, there might be some nuances depending on the manufacturer and the model, hopefully taken care by the driver. Oh yeah.. You'll need the driver.
I remember reading some posts and possibly some examples somewhere in this forum. I'm sure a search will reveal a lot of information. -
I forgot my password for my macbookpro. I tried many options, but nothing is working, ow can i reset it without changing any other info on my apple ID?
Follow the instructions in ths article.
http://www.coolestguidesontheplanet.com/reset-forgotten-admin-password-osx-10-8- mountain-lion/ -
With this version of Firefox, it automatically loads the 'next' page. When I'm reading blogs, when I click to go back, it automatically loads the first page of the blog as the 'next' page I want to go to. However, it will load this page OVER the page I am on, so that I cannot see it. With some blogs, it is so extreme, I cannot use Firefox on them at all. This isn't an add-on or anything, and I cannot find it in the preferences panel. Can I turn it off somehow/is there a way to in Firefox 4?
That is not standard behavior. You may have installed an extension that causes it.
Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
* Don't make any changes on the Safe mode start window.
See:
* [[Troubleshooting extensions and themes]] -
How can i Auto Size the Column width in RDLC Report
Hi Friend's,
I have created Windows application with RDLC Report. I am binding(Generating) dynamic columns and data's in RDLC Report Using Matrix control, I need to make Auto size of Column width for each Column in
Matrix of RDLC report. So Can any one suggest me to make the Auto Size of Column Width in RDLC.
Thanks in Advance,
Mohan GHi Mohan,
In Reporting Services, the column width/height is hard-coded, hence, we cannot set the column width/height dynamically or based on an expression. So is the report size.
In addition, since it is a RDLC report, we need a ReportViewer control to display this report within a custom application. If you need to change the size of the whole report, we can set the AsyncRendering property of the ReportViewer control to false, and
set the SizeToReportContent property to true.
Regards,
Mike Yin
TechNet Community Support -
Export Indd to EPS/JPG and set the file name for EPS/JPG file
Hi,
When I export the INDD to JPG/EPS, I want to set the file name with pageNumber for JPG/EPS files using javascript.
For Example
If I set the file name as EPSFile.eps, after exporting the indd(with 2 pages) to eps
,files are generating in the following name EPSFile_1.eps, EPSFile_2.eps.
but I want to set the file name as EPSFile_001.eps and EPSFile_002.eps using javascript.
anyone knows please reply for this.
Regards,
MubeenHi,
I tried the following code.
var JPGe = new File("Applications/PDF/JPG/file.jp");
app.activeDocument.exportFile(ExportFormat.jpg, );
when I use this code ,exported jpg file names are
file.jpg, file1.jpg,file3.jpg.
but ,I want the output file names as file_001,file_002,file_003,
Thanks,
Mubeen -
how can I download an more than one audio cd to itunes, scramble all and then transfer all back to a R/W cd?
Import the CDs to iTunes one at a time, following these instructions.
Once the tracks are in your iTunes library, put them into a playlist, and get them into the order you want. Or if you by "scramble" you mean a randomly shuffled order, use the crossing arrows at the lower left to do so.
When you are ready, insert a blank CD, use the command File > Burn Playlist to Disc, and create an audio CD. I strongly suggest using CD-Rs rather than CD-RWs, since the latter often have trouble in normal CD players. -
I have created a pdf and then want to send it to my boss. When he recieves it it is saved in the 14 X 8.5 inches version. How can I saved it on my end as a 11 x 8.5 inch so he doesn't have to uncheck "Choose paper source by PDF page size"?
Hi heathers,
You would need to print the file to a new PDF with the appropriate page size.
Best,
Sara -
How do I preserve the embedded hyperlinks when printing to .pdf?
I am using Acrobat Pro XI for Mac, and when I export to .pdf the existing hyperlinks lose functionality. I assume it’s just the flick of the right button – I just need help finding that button.
Can you help? Thanks!How: MS Word to .pdf by Command P, hitting the PDF button, and then the button for "save as Adobe pdf"
I didn't have this problem at all on prior versions of Adobe on my PC. This isn't a Mac attack, is it? -
How can I download a previously downloaded purchase to my iTunes library on my laptop when the listing for the song in my library won't play because it says it cannot locate the file. Yes I have searched my iTunes folders and also done a full windows search. The track plays on my iPad and my iPhones but will not play on my laptop!?
It has an "!" To the left of the song title in my library
My worry is that if I sync my iPad/iPhone then I will lose the track on those also!If you cannot find the file on your hard drive then once you delete the current broken entry you should be able to redownload from iTunes in the Cloud. This assumes the item in question qualifies. Note that audiobooks, digital booklets, iTunes LPs & Extras, ringtones, selected movies etc. don't.
If prompted don't hide the item. You may find that you need to close and then reopen iTunes before it will appear for download.
tt2 -
How can I backup the iPad to the non-C drive of the computer that runs the itune? I have already setup the library at a NAS and seems only media file are stored int he library. iPad backup still need to take use my C: drive that is running out of space
Windows - Change iPad default backup location
http://apple-ipad-tablet-help.blogspot.com/2010/07/change-ipad-default-backup-lo cation.html
Windows - Changing IPhone and iPad backup location
http://goodstuff2share.wordpress.com/2011/05/22/changing-iphone-and-ipad-backup- location/
Cheers, Tom
Maybe you are looking for
-
Does "Adobe Send" memorize the e-mail addresses I send to repeatedly, as "Send Now" did?
In Adobe "Send Now", it was much easier to send a personalized link to multiple e-mail addresses. Plus, once I used and e-mail address, it memorized it. I am a university professor at a school where we use the Exchange type of account. How can I a
-
"#" character showing up when saving as PDF in FM 8?
Hello, We've used FM for years, for operator and service manuals - we just upgraded to FM8, and have a new problem. When we save as a PDF, we get the # character at random points in the PDF - there is no rhyme or reason for their appearance or their
-
Material workbench displays a zero quantity
Dear All, When I did a Miscellaneous Issue of an item, it was still showing onhand quantity Item Available is 1 No Did Miscellaneous Issue: 1 No Not available in the Transactions Temp (pending Transactions) but now in the Material Workbench the item
-
i have two controllers 4402and 15 WAP 1250s with both radio AGN i need to configure the client to support maximum Speed please advice what is the best Practice configuration for Both WLC and client (the maximum speed for 2.4Ghz GN-radio) the Laptop a
-
How to call other Entity service
Hi, How to call other Entity service to our entity service? Regards Ashif