Archive for category Graphic arts

InDesign CS2 export script

This very useful JavaScript code was developed by Peter Kahrel as he found my problem interesting. Bless you Peter! The full thread is over on the Adobe’s InDesign Scripting Forum here abouts. Because there’s only a limited life for any post over there – I’m dumping here too for posterity.

The purpose of the script is to export single page PDFs from a multi-page InDesign CS2 document where the page numbering has been set via page Numbering and Section Options. PDFs are exported to a predetermined PDF setting: “PDF_X-1a with Bleed & co” in my case. The resulting file PDFs are named with a three-digit prefix corresponding to the page number in the InDesign document and a user defined base name – defined when the script is run.

A basic version of this script is supplied by Adobe in with the extras for an InDesign install but unfortunately that falls over when there is a Named Section present. Getting a stray Named Section in your document is very easy. Easier for some users mind – but still very easy. Peter – I still owe you a beer or three…

Here is the magic script:

#target indesign 

if(app.documents.length != 0)
   {
   var myFolder = Folder.selectDialog ("Choose a Folder");
   if(myFolder != null)
      {
      myExportPages(myFolder);
      }
   }
else
   {
   alert("Please open a document and try again.");
   } 

function myExportPages(myFolder)
{
var myPageName, myFilePath, myFile;
var myDocument = app.activeDocument;
var myDocumentName = myDocument.name;
//This next line sets the PDF export Setting
var myPDFExportPreset = app.pdfExportPresets.item("PDF_X-1a with Bleed & co")
var myDialog = app.dialogs.add();
with(myDialog.dialogColumns.add().dialogRows.add())
   {
   staticTexts.add({staticLabel:"Base name:"});
   var myBaseNameField = textEditboxes.add({editContents:myDocumentName, minWidth:160});
   }
var myResult = myDialog.show({name:"ExportPages"});
if(myResult == true)
   {
   var myBaseName = myBaseNameField.editContents;
   myDialog.destroy();
   // Remember the state of each section prefix
   var section_states = myDocument.sections.everyItem().includeSectionPrefix;
   // Get all section-prefix names
   var section_names = app.activeDocument.sections.everyItem().name;
   // Enable all section prefixes
   myDocument.sections.everyItem().includeSectionPrefix = true;
   // Create two parallel arrays with page numbers:
   // one with numbers preceded by section prefixes,
   // the other with bare page numbers
   var page_ranges = [];
   var filename_pagenames = [];
   for(var i = 0; i < myDocument.pages.length; i++)
      {
      page_ranges.push (myDocument.pages.item(i).name);
      var temp = strip_section (myDocument.pages[i].name, section_names);
      filename_pagenames.push (("00" + temp).slice(-3))
      }
   // Restore the section-prefix settings
   restore_section_states (myDocument, section_states);
   // Export each page
   for(var i = 0; i < myDocument.pages.length; i++)
      {
      app.pdfExportPreferences.pageRange = page_ranges[i];
      myFilePath = myFolder + "/" + filename_pagenames[i] + "-" + myBaseName + ".pdf";
      myFile = new File(myFilePath);
      myDocument.exportFile(ExportFormat.pdfType, myFile, false, myPDFExportPreset);
      }
   }
else
   {
   myDialog.destroy();
   }
} 

function restore_section_states (doc, states)
{
for (var i = 0; i < doc.sections.length; i++)
   doc.sections[i].includeSectionPrefix = states[i];
} 

function strip_section (pg, array)
{
for (var i = 0; i < array.length; i++)
   if (array[i].length > 0)
      if (pg.match (RegExp ('^'+array[i])) != null)
         {
         pg = pg.replace (RegExp ('^'+array[i]), '');
         break
         }
return pg
}

, , ,

No Comments

A Flickr slideshow iFrame in WordPress?

A-ha! So this is how it’s done…

For the full experience you’d need a canvas (or theme) that accommodates the Flickrslideshow minimum dimensions which are roughly 580px wide x 360px high. Right now this site’s main content div is only 500px wide – so there’s a bit of clipping on landscape images. But not enough to worry about too much just yet.

The code is this: <iframe style="border:0" width="500px" height="400px" src="http://www.flickr.com/photos/lazydada/sets/72157603491230286/show/">

, , ,

No Comments

miscellany

The Flashing Blade.

Currently here. Childrens’ TV from way back in the seventies. You remember this one? I do. The theme tune is baked into my memory for ever.

Flickr viewer

Tiltviewer is a very cool way to see your Flickr stream. Or mine. I like what it does; somewhere between a slideshow and browser. Much cleaner interface than Flickr’s pages. Smells of the future. Very clever. Here is their ‘ome page, Mr ‘iggins.

Carbon Copy Cloner

I’ve stumbled upon the fact that this backup software stalwart for Mac OS X has finally been updated. Time to give it a whirl again. Which reminds me …

Hard-drive upgrade. Again.

Not quite two years since the last upgrade I’ve done it again. This time not precipitated by a dead-disk but by a severe lack of space. 160GB drive swapped out from my LaCie external drive. Not a quick fix but a good one. And I took to opportunity to give the old girl a good clean. How nice. Shinny Aluminium. Thanks to the folks at iFixit for the online guide.

Photogasm

Last but by no means least. My friend Mick Partridge created Jude Edginton’s website. Jude’ photo’s are really very good. Really. Nice site Mr. Partridge.

, , , ,

2 Comments

blinker

blinker

No Comments

Of British expats, French electronics shops, Spanish newspapers and Canadian photographers.

As a British expat in Spain I have always found Spanish newspapers hard going. Not so much due to my lack of vocabulary as the dense and repetetive style of many of the supposed better newspaper’s I’ve read. Maybe this is down to bad luck (OK add frustration of the real limits of my Spanish vocabulary) but I’m not a great fan of excessive commentary.

Anyway – I’ve found a newspaper here that I like to read. It’ll do wonders for my vocabulary. And it’s free. And it’s lovely to look at (seeing as I’m in that game).

Given away outside the FNAC (the best consumer electronics and media shops in Spain) in La Cañada, is a stand with ADN. I don’t visit La Cañada too often and ADN isn’t always there – but it is a very well crafted Berliner. The Edition I get is Malaga-centric, but with a good national and international coverage.The penultimate edition I grabbed (the November 19 edition) was full of very strong photography. The cover image was ZP (The man Zapatero) in a black suit giving a thumbs-up salute against a black background. An almost awkward composition gave half the frame to that plain background. His face well lit but half covered by the raised hand. Striking, perhaps twisted, composition very apt for politician’s portrait. On p.2 ADN reserves half a page for La fotographía. There, an arresting photo of a Canadian infantryman in Afganistan. Piercing blue eyes looking out from a heavily bearded face. Looking out of the page and straight through me. Licenced by Reuters, Finnbar O’Reilly the photographer.  A bloody good one too.  

No Comments

Illustrator PDF reply on Adobe forums

What I said was…

There are many pitfalls to be avoided when working in Illustrator. Beyond it being buggy and a hog I find it’s not a great tool for working on any press-ready artwork. [Disclosure: InDesign fanboy here].

Firstly, as Aandi notes, avoid flattening artwork (ie printing to PostScript or saving as PDF 1.3 or under) – as that causes many transparency effects, including drop-shadows, to be converted into raster art.

If you must export flattened artwork don’t forget to set the “Document Raster Effects Settings” (under Effect on the menu bar) to a suitable level. Unfortunately the default is 72dpi.

Also ensure that any important type or vector information is kept in a separate layer above “background” objects. The idea is to add a virtual layer of separation between type and effects. “In Front” and “Behind” is not enough – use layers. [The same applies for InDesign.]

Again Aandi is spot on: the “Save PDF with editing capability” feature can cause massive file sizes; the difference with the PDF of the cover of the magazine I work on: a few hundred MB or just a few MB!

Another thing try to remember to use “Save a Copy” or to otherwise be careful not to get your final delivery artwork confused with the working file. Its’s an inherent confusion in Illustrator: PDFs should really only be used as final artwork – not as a working file. I don’t like that at all. Particularly as I have to deal with these ambiguous duplicate files at work. Add an extra note to the file name or something. Please!

I said it here

, ,

No Comments

Nikon full frame

I’m so excited and I just can’t hide it
And I know, I know, I know, I know, I know I want you

er…

Anyway the D3 is announced – my desire to get into full frame digital may well be lest costly than moving over to Canon. Assuming that there will be a lower cost FX model coming out in the not too distant future.

Nikon D3 - Nikon's first full frame DSLR

,

No Comments