Escolar Documentos
Profissional Documentos
Cultura Documentos
About ?
Content
Lets get some Image and Text Information! Tutorial #1, #2 and #3 Need some JAVA coding experience Optional: InDesign CS 4 to create Demo Files
Why ?
You want to check out the IDMLlib in a few minutes You want to see how easy it is to code a QA workow
Export / Create IDML Files Access IDML Containers Brief overview of the IDML structure How to access basic information from IDML docs
get some Information from the images on a spread get the content of text page items in the spreads
Basically we parse spread by spread through an IDML le and get the information we need! After this Tutorial you will be able to code your own Quality Assurance Workow!
something like: Are all images accesible correct color proles ? spellchecker for text content anyone ?
Images
we got image on the rst spread and 3 on the second spread one text box on the rst spread, center alligned two text boxes on the second spread
Text Boxes
actual ppi is the resolution of the image coming from the graphics program (e.g. Photoshop). Usually 300 ppi for offset printing. If this is 72 ppi it might be a lowres resolution image you do not want to use and maybe want to exchange! effective ppi tells you if an image was placed in Indesign and was then enlarged. What happens is that you now have less pixels of course and the nal result probably looks terrible. The way to do it is to resize and retouch the image in Photoshop! Not in the layout program. Or get a better quality image !
7
This is it:
Code reviewed
get a list of all Spreads (see Tutorial #2 for explaination) now we iterate through all spreads
Spread theSpread = document.getSpreadById(spreadId); System.out.println("\nSpread: "+ spreadId + " with " + theSpread.getPageCount () + " page(s)");
and here we access the Spread ID and the number of pages. Remember a spread can have several pages!
List<Rectangle> rectangles = theSpread.getRectangleList(); now accessing all rectangles on the spread, rectangles can contain images.
if (rectangle.getImageList().size() > 0)
Image image = rectangle.getImageList().get(0); Link link = image.getLinkList().get(0); get the link that hold all kinds of information
Date linkImportTime = link.getLinkImportTime(); System.out.println("Imported Image Time: " + linkImportTime); for instance the time the image was imported into the document!
String linkResourceURI = link.getLinkResourceURI(); System.out.println(linkResourceURI); or the storage path to the image (local or from a server ?)
Double effectivePPI = image.getEffectivePpi().get(0); Double actualPPI = image.getActualPpi().get(0); System.out.println("actualPPI: " + actualPPI + " effectivePPI = " + effectivePPI) nally the actual and effective PPI - check for lowres images ...
10
Output
11
12
access images and text from the IDMLlib you can work with that content now probably have by now an idea about how powerful the IDMLlib can be for your workow
Next ...
add a spell checker for central spell checking modify and save documents (later in Q1/2010) access complex image groups
13
rst we get a list of all available spread ids then we iterate through those
for (String spreadId : spreadIdList) Spread theSpread = document.getSpreadById(spreadId System.out.println("\nSpread: " + spreadId + " with " + theSpread.getPageCount() + " page(s)"); get the spread id and the info how many pages are there now we access all the textframes on the spread iterate through all text frames on the spread
List<TextFrame> textFrameList = theSpread.getTextFrameList(); for (TextFrame textFrameId : textFrameList) String parentStoryId = textFrameId.getParentStory(); the parent story is the assigned story of the text frame
15
then we get the story by id from the document get the rst paragraph style range from the PSR list get the allignment of the paragraph style range
ParagraphStyleRange psr = story.getParagraphStyleRangeList().get(0); Justication justication = psr.getJustication(); String content = psr.getCharacterStyleRangeList().get(0).getContent(); we get the rst character style range and access its content print out the content and print out the justication of the paragraph style range System.out.println(content); System.out.println("The Justication is: " + justication);
16
System.out.println(content);
17
TextInfo output
18
Ressources
for dev info contact Mr. Fink instead: ank@fhcon.de Yes we were not kidding when we claimed the IDMLlib is easy to use !
Watch the usual channels for a new tutorial / video ! Please give feedback ! We love to hear from you
19