Read EPS File in JScript

Hi scripters
I am placing EPS file as inline object into indesign via JScript,
doc = app.activeDocument;
doc.pages.item(0).place(File("D:\\auto\\Chapter-3\\fig1.eps")
here while i am placing the EPS files into indesign inline object i want to read the BoundingBox values stored in the EPS files. It is possbile to read EPS files in JScript?
thanks in advance
regards
a r u l

It is possbile to read EPS files in JScript?
JScript is not supported by InDesign. I'll kindly assume you meant "Javascript", but be aware that JScript is not Javascript.
It's possible to read any kind of file with Javascript. Any file at all. This snippet
epsFile = File("D:\\auto\\Chapter-3\\fig1.eps");
if (epsFile.open("r") == false)
alert ("Why don't you try an existing file?");
exit(0);
do
someLine = epsFile.readln();
if (someLine.indexOf ('BoundingBox') > 0)
  break;
} while(epsFile.eof == false);
epsFile.close();
reads text lines until it runs out of text lines or encounters one with the exact phrase 'BoundingBox'.
However, Javascript does not automagically know what it's reading. EPSs may contain binary information, so you can't use plain text reading functions. So you need to read binary code -- and for that, you need the exact binary file format of an EPS.
In addition, you need to parse the context of the string 'BoundingBox' as well. It might appear in a text ("This image shows a BoundingBox of ..") or a comment ("%%This image does not have a BoundingBox"), or with extra parameters or parameters missing.
Long story short, "yes, it is possible to read EPS files".

Similar Messages

  • InDesign CS6 can't read EPS files from earlier version of InDesign

    I have a series of six violin method books (Kaleidoscopes for Violin) that I created in InDesign CS2. 
    Having now upgraded to InDesign CS6, all of the EPS files used in these books -- hundreds and hundreds of files -- are unreadable by the program.  I receive the error message, "Error encountered while reading TIFF image. Image may be damaged or incompatible. Resave the image with different settings and try again."
    Another user, ratgui, reported this problem on February 2, 2013 (two months ago) and has received no response.  This user's files are also music files, imported from InDesign CS4 (more recent than mine).
    Needless to say, there is nothing wrong with my EPS files, given that every single one of them was read correctly (and is still read correctly) by the older, supposedly less-advanced version of InDesign!  The only work-around currently is to save each image in PNG format (luckily Sibelius exports to PNG).  For 600-800 files, this represents three or four full days of unnecessary work, and will double the number of images on my hard drive.
    The EPS issue is a remarkably serious flaw in a software package that costs many hundreds of dollars, especially given that I posted the same problem in response to the release of InDesign CS5.  A response (and, I daresay, a software update that fixes the problem) would be greatly appreciated. 
    As a side note to the developers -- it is super, duper cumbersome that this error arises in a separate pop-up box for EVERY affected image.  These pop-up boxes must be dismissed one at a time.  Worse yet, once you have dismissed the error message for a given image, the message appears AGAIN if you return to the same page!!  This unnecessary hassle makes it impossible to even work with the underlying document.  Placing the error message in the links palette would save a great deal of headache.  It is fairly obvious that the images aren't being read properly ... they all appears as gray boxes.
    Thanks!!

    Hi Peter
    Many thanks for your advice; I re-defined the printer presets and now it works fine.
    Andi A

  • How to read *.eps file?

    I have mailed a report. This report gets converted into report.eps file. Now how to open this file?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by parshuramb:
    I have mailed a report. This report gets converted into report.eps file. Now how to open this file?<HR></BLOCKQUOTE>
    I just found the following 10 questions bellow!
    With which application I can open *.eps file - Generated by report while choose mail option for output.
    Thanks
    IP: Logged
    paul green ()
    unregistered posted February 12, 2001 02:04 PM
    there is an application called (i believe) ghostscript. The file format is postscript format, and thus, must be opened with a postscript reader. I believe adobe makes such a reader as well, although I'm not sure of the name.
    null

  • Upload local PSD or EPS file into flash-movie at runtime

    Hi there, I would like to upload a local PSD or EPS file into a flash-movie at runtime. I'm sure the data will have to be encoded into a PNG file for it to be displayed properly in the movie to include any transparency. Any ideas? I can't find an EPSEncoder or PSDEncoder. Thanks.

    That's a bumpy road, especially considering the rapid pace of PSD evolvement. You can always find a disgruntled coder trying to deal with the process of unpacking PSD but if you look there's some older libs still out there trying to do it, YMMV. You really need to keep the PSD simple however.
    I remember a while back AlivePDF could read EPS files, although I'm not sure to what extent. Might be worth a try.

  • How to use .eps files in Adobe Photoshop CS

    I purchased some vectorshapes from Vectorstock, and downloaded .zip files to my desktop. I then extracted the files to the /presets/customshapes folder in Adobe Photoshop CS. (I have Windows 7). I then found out they were not .CSH files but Encapsulated PostScript or .eps files. How can I use them in Adobe Photoshop? Please help

    Thanks, that helps.

  • Can you remove XMP data from .eps files in Illustrator-CS5.5?

    Background:
    I'm using font software called Typetool 3 and Illustrator CS5.5.
    I am using these on Windows 7, 64 bit.
    This is entry level font software released by Fontlab.
    This software accepts artwork through the .eps file format in both theory and practice.
    However: it refuses illustrator CS5.5 .eps files.
    When I looked at this I came up with two highly interesting things: First- CS5.5 illustrator files are roughly 13 times the size of CS5 files, of this type (a simple font glyph-comparing a 29-30 kbfile to a 420-450 kb file in cs5 and cs5.5 respectively).
    Thing two came from looking at what that data was (by opening it in a text editor). It appears that some of the data XMP data, illustrators data for tracking things like who created the file, copyright, and other. In document info many of these fields were blank. I'm sure this isn't the only issue because my exported xmp data is 64 kb large, but it does account for a chunk of the file.
    The main question being: Can this xmp data; which for my purposes is redundant, because I have to put copyright and other data in the font, be removed or not included at the point of document creation?
    The technical question being:Can the file be saved in a manner which will allow it to be exported from adobe CS5.5 and imported into Typetool 3?
    Things I've tried:
    In saving .eps file: removing document headers, previews, color data, saving as different versions of the language. Basically saving it without all settings.
    In saving .ai file: saving without any settings checked (without compression, pdf editting, ect.) and saving it to a different level of illustrator.
    I do not know enough about postscript programming to navigate the file or remove the offending data. Nor do I have time to do this over multiple glyphs.
    As a matter of opinion I do not like that my software is including potentially identifying information (which is one of the intents of XMP data, to provide identification) without notifying the creator, let alone allowing me to keep it from doing that. I would not mind or bother-except for the fact its messed up an established workflow. If someone editted this data without my knowledge, say with a virus or heaven forbid manually, it would be also be bothersome. Having a check that identifies that I am sending this data out would give me something to know if this situation was in fact happening. Additionally for a situation like mine-communication between programs in a closed environment where no other users are involved, its unnecessary and wasteful... like putting gold rims on what is intended to be an oxcart.
    I'm planning on going to Fontlab for later this week, as it is as much thier issue as it is Adobe's. From what I know XMP is both a useful and popular technology- having a workaround for this situation seems like it would be a good idea. If necessary I can attach some working files for comparision.

    I would save it as EPS (version Illustrator 3). This should be compatible to almost any  software that takes EPS.

  • Unable to open .eps file "unknown format and cannot be opened" ?

    A client sent me an .eps file (logo). I tried opening it in Illustrator AND photoshop (just to see if it was saved in one vs the other program) - however to no avail.
    Illustrator gives me a message "unknown format and cannot be opened"
    Photoshop gives me a message "photoshop was unable to parse the postscript".
    I'm using Adobe CS4, and I've never seen this message before—would love to know what this means and how to resolve?
    File attached if anyone is able to open / fix it?
    Thanks kindly,
    Chemol

    Thanks for the advice Scott - does compression improve the .eps?  Is it
    silly for me to ask them to compress it since the file is only 766 KB
    (that's how big the attachment is in my email - though I am unable to open
    it)?
    My friend is able to open it on his end - however the 3rd person (client) is
    the one who sent it, and I have already requested a different version - no
    response from them yet.  Unfortunately what the company "has" is what he
    will likely give to me again (ie: same file / unable to open).  So ... I am
    curious about how I can resolve this issue on my end - if possible?
    Do you know what the AI and Photoshop error messages mean? Could the issue
    be a mac vs PC concern? Or is it a corrupt file? Could it be a software
    version issue (old vs new) ... or Quark incompatibility?
    .... just guessing at this point....Any insight as to what different
    scenarios may apply in this situation would be greatly appreciated ..thank
    you.

  • Image Processor Pro and Picture Processor load eps files without rasterizing them

    Hi. My name is Lucas. Im from Argentina, now living in Brazil. I have the problem that is in the title. Im new doing this stuff but reading a lot i discovered that both scripts open eps files and because they dont get reasterized, then saved files looks preety bad.
    I know that there are some parameters to open eps, ex:
    var epsOpenOptions = new EPSOpenOptions();
       epsOpenOptions.antiAlias = true;
       epsOpenOptions.mode = OpenDocumentMode.RGB;
       epsOpenOptions.resolution = 72;
       epsOpenOptions.constrainProportions = true;
    I have to say that looking for a solution a found a script and modified to suit partially my needs. I said partially because i need the script to look folders and save output files with same structure. Here is the script that manage one folder at a time:
    #target photoshop
    // Asks user for input folder
    var inputFolder = Folder.selectDialog("Select a folder to process");
    // Asks user for output folder
    var OutputFolder = Folder.selectDialog("Select a folder to save your Tiffs");
    if ( inputFolder != null && OutputFolder  != null ) {
       // Makes list of all files located in that folder
       var fileList = inputFolder.getFiles( "*.eps" );
       // Create a EPS option object [height & width are doc size]
       var epsOpenOptions = new EPSOpenOptions();
       epsOpenOptions.antiAlias = true;
       epsOpenOptions.mode = OpenDocumentMode.RGB;
       epsOpenOptions.resolution = 72;
       epsOpenOptions.constrainProportions = true;
       // Open each file in turn
       for (var i = 0; i < fileList.length; i++) {
          // open the file
          app.open( fileList[i], epsOpenOptions );
          var baseName = activeDocument.name.slice( 0,-4 );
          // put your code to 'save as' the file here
          var saveFile = new File ( OutputFolder + "/" + baseName + ".jpg" );
       SaveForWeb(saveFile,60); // set quality to suit
    function SaveForWeb(saveFile,jpegQuality) {
      var sfwOptions = new ExportOptionsSaveForWeb();
      sfwOptions.format = SaveDocumentType.JPEG;
      sfwOptions.includeProfile = false;
      sfwOptions.interlaced = 0;
      sfwOptions.optimized = true;
      sfwOptions.quality = jpegQuality;
    activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
    activeDocument.close( SaveOptions.DONOTSAVECHANGES ); 
    So, if you know some way modify image processor pro or picture processor i will be very pleased.
    Because i will only use the script to manage eps files and save them as jpg (save for web) i dont need an special button to activate that option. Keep it simple. Thanx!!

    You can tweak ImageProcessorPro.jsx by make the following edit.
    Search for code that looks like this:
    ImageProcessor.prototype.openDocument = function(file) {
      var self = this;
      var settings = self.settings;
      var mode = DialogModes.NO;
      var ext = file.strf("%e").toLowerCase();
      var isRaw = ImageProcessor.CAMERA_RAW_FILES.contains(ext);
      if (isRaw) {
    and insert this code right after it:
      if (ext == "eps") {
        var epsOpenOptions = new EPSOpenOptions();
        epsOpenOptions.antiAlias = true;
        epsOpenOptions.mode = OpenDocumentMode.RGB;
        epsOpenOptions.resolution = 72;
        epsOpenOptions.constrainProportions = true;
        try {
          var doc = app.open(file, epsOpenOptions);
        } catch (e) {
          Error.runtimeError(9002, ZStrings.UnableToOpenErr);
        return doc;
    I haven't tested this at all but it looks good from here.

  • Can't export an EPS file from Photoshop CS5 and open in Illustrator CS5.

    I'm on Mac OS X Lion 10.7.5
    I am making DVD covers for print. The barcodes for the DVD covers have to be done in Illustrator. But the original designs are done in photoshop including the text. For years this hasn't been a problem. Right before adding the barcodes I create an EPS file from photoshop, open that file in Illustrator and all my text is automatically coverted to perfect crisp clean vectors, viola! I add the barcodes and export the PDF for the printers.
    But now I can't open my EPS files in Illustrator CS5 even though I'm exporting them the same way I always have from Photoshop CS5. Illustrator says... "The operation cannot complete because of an unknown error." --> Note it does not give an error number after this warning like I see it does for so many other people.
    I have been trying to fix this for over 10 HOURS spanning 2 days! I'm infuriated I can't get help from Adobe on this and have read all the forums and don't see my problem listed anywhere.
    I've tried:
    - Deleting the .plist file and the Settings folder & resetting my permissions
    - Uninstalling and Reinstalling Illustrator
    - Turning off all other applications
    - Creating more disk space on my hard drive (even though I have 200gb available)
    - Restarting the computer
    - Disabling my Font book and still I can't open the EPS file
    I thought maybe it's possible it's the font I'm using Fontesque OT so I even tried converting text to objects prior to exporting the EPS file from photoshop to illustrator and turning off my font book, but still it won't open. And if I open the PSD directly in Illustrator, text comes out a bit fuzzy in the PDF I export.
    If anyone can provide any solutions I would be so grateful! I'm at my wits end here, this should have taken under an hour to do and now it's ruining my entire weekend. I'm completely panicked because I was suppose to have these to my client over the weekend so they could turn them in for Print frist thing on Monday morning and of course Adobe provides no chat support or phone support after 7pm on weekday or on the weekend which is when this all started.

    I never even thought of reinstalling photoshop, but I think this was a font issue. I'd never saved an EPS with Fontesque OT Regular enabled, only Fontesque OT Bold. Somehow I think the font was causing the problem because ridding the font from the equation allowed me to open the EPS file.
    After 12 HOURS of trying different things I found a WORK AROUND...
    I had to:
    - Select the Text in Photoshop (with Fontesque OT enabled)  --> Select Create Work Path --> Covert to Shape on each of the text items
    - Save EPS file out of Photoshop
    - Disable Fontesque OT font in Font Book
    - Then open EPS in Illustrator add in my Barcodes and export the PDF
    (the barcodes have to be added in Illustrator because they need to be pure 100% black with no CMYK color in them. You can't save them out of Photoshop that way, only Illustrator, otherwise I would have made my pdf straight out of photoshop like any other normal human
    This work around is the only way I could get the EPS files to open in Illustrator and still have the text remain super crisp like a vector.
    NOTE to others in the future about crisp text from Photoshop to Illustrator:
    - Simply "converting to shape" did not preserve the vector. You have to Select Create Work Path --> then Covert to Shape on each of the text items (with the font enabled) for this to work and preserve the crispness of the text. Even creating "smart object" did not truly preserve my vectors or the text crispness in the EPS file once I imported it into Illustrator.
    DrStrik9 thank you SO MUCH for trying to help me. You did give me ideas that helped me figure out the workaround and also helped me feel not so alone as I struggled through this. I'm going to follow up with your other suggestions about reinstalling photoshop and also checking my RAM, etc. But I just want to that you so so so SOOOO much for all your time and consideration in this matter. I hope you have a wonderful amazing week ahead and that someone does something very nice and thoughtful for you too

  • How to upload and edit an eps file

    Hi all,
    I have just downloaded an eps file from shutterstock and they given me this free trial idea with adobe but unfortunately i have got no idea how to upload my file and edit it and save it as a jpg file for further work. can anyone help me please

    you can use adobe illustrator to open that file.

  • How to create a eps file from illustrator?

    I am new to illustrator and new to creating logos for print, I usually only do it for the web.  I am creating a logo for my team so that it can be printed onto a jacket.  I created an all white logo because the jacket is black.  I was asked to send an eps file.  I created the logo in illustrator and saved it as an eps file and as a pdf file thinking the printer could use the pdf for viewing.  When I open the pdf file, the only thing that's there is a soccer ball, my text and a few other things are missing.  When I open the saved eps file, the same thing, I have to go to select all to see all my other stuff in the eps file.  How do I save my file as eps and know that it's attaching everything I have within the illustrator file and how can I view the logo as a pdf?  Any help you can give would be greatly appeciated, thanks so much!

    How did you similate the black color?
    Since Illustrator does not have a background, you must create one with the rectangle tool, drag out a rectangle the size of the document and then move it to the back. That rectangle can then be filled with black.
    Also look in your layers panel and see what you have for objects. You can select them there and move them up or down to bring them forward or backward on the document. It can also make it easier to select when the object is below others.

  • How do I fix a problem with .eps files not showing up properly in icon view

    Actually my .eps files are not showing properly in any of the views but icon view is most important to me.  I am using OSX.8.5 on a mac mini and mac book air.  Almost all of my .eps files are conversions of .wmf files converted to .eps by WMF Converter software.  All of these files used to be on a PC running windows Vista using ST Thumbnails explorer to be able to view thumbnails.  For background info: I had to use a program to view the WMF files becasue hackers could put viruses into the thumbnail for WMF fies so instead of fixing the problem Microsoft disabled the thumbnail view for all WMF files. 
    A few of my .eps files are conversions of files created in CorelDraw 3x and converted to .eps in CorelDraw 3x.  Both types of .eps files misbehave the same.
    I downloaded one .eps file today from the internet to see if it would misbehave the same way (it does).
    Here is the problem: After a reboot when I first view a folder that contains .eps files in icon view I can see the file contents fine.  If I use the resize slider at the bottom of the window or resize the window itself then some or all of my .eps files revert to displaying the "generic icon" of a Loupe with a picture behind it.  If i can manage to put the resize slider to exactly where it was then my icons display the file contents as they did before I messed with the slider.  There seems to be no rhyme or reason as to when an icon will display as the file contents or when the generic icon comes up.  In some folders all the icons display correctly at the smallest icon size and in other folders the icons may display correctly or as only generic or a mix of generic and file contents.  Icons to files that came from the same source will not necessarily display the same way.  Icons to files that came from the same source and were converted by WMF Converter at the same minute do not necessarily display the same way.  If I display "info" for the files sometimes the previev pane of the info box will display the generic icon or sometimes it will show the file contents.  If I take an .eps icon that displays properly and drop it into a folder where all .eps icons are displayed as generic then that icon displays generic.  When I move that same icon out of that folder then it will display properly.  Icon view, list view, column view and cover flow view all display differently with no discernable pattern.  Sometimes I can see file contents in column view and not icon view.  Sometimes in cover flow and not in icon view.  It makes no difference if I have a handful of .eps files in a folder or hundereds of files in a folder.  After an undetermined amount of time the icons might display properly again or maybe not.
    What I have done so far:  exhaustive search of the internet did not find anyone else with the same issue.  I checked and fixed all disk permission errors that disk utilities would fix.  I know that icon view and quick look are two different things, but, I did however, download and install an eps quicklook plugin that did not seem to make a difference for my issue.  BTW Quick look sometimes works and sometimes not (no discernable pattern to this behavior either).  I tried the cnet download fix for quicklook just for grins.  It had me force QL to reload plugins and it's cache then I cleared out the QL configuration files.  This did not seem to make a difference in the behavior of icon view or Quicklook.  The only two things I have found to be consistant are 1)  The "open with preview" always works but I know this is different because this preview actually generates a pdf view of the file. 2) When the icon does display the file contents it always displays correctly.
    When you read this please be mindful of:  I am a Microsoft refugee not yet familiar with the Apple world so you may have to tell me how to do "simple" things.  I have no idea what is the difference between a "thumbnail" or a "preview" or the behind the scenes way that apple generates the icon appearance for the 4 different views. 
    Any assistance would be greatly appreciated.  I tried to insert a screen shot but got an error message when I did it.

    Was the error number really 0XE8....
    iPhone, iPad, iPod touch: Unknown error containing '0xE' when connecting

  • Very slow working with eps files over new network

    Please help!!!
    Our IT has recently upgraded us from a OSX server to a 2 Terabyte SNAP SERVER 520.
    I am using the only INTEL Mac in the department (we have another 10+ G5 PPCs running 10.4), and the only one using OSX 10.5. Since changing to the new server, I am also the only one with several file saving/opening issues.
    I believe this is a network issue.
    It is with mostly ADOBE products and we all know they will not support, working over the network. Due to the volume of files, I simply cannot drag files to my HD, and work locally. It is not practical. I also know that we have not had any issues in the past, and don't see why I can't get to the root of the problem.
    **The most obvious issue is Illustrator .eps files.**
    I can open and save .ai files in good time both locally, and over the network. There is no difference either way. HOWEVER, if it is an .eps file working over the network is not practical. I get the spinning wheel for about 2 minutes each time I open, save, or make a change. It is VERY slow. Working on eps files locally is fine (about the same speed as .ai files), but as soon as it hits the server, it is painfully slow to do anything.
    Additionally, when saving Photoshop, Illustrator, InDesign AND Quark 7 files (direct to the network), I am regularly getting "Could not save because write access was not granted", or "Could not save becasue unexpected end-of-file was encountered", or "Could not save because the file is already in use or as left open" type errors.
    I simply then click 'OK', and then hit save again, and it either gives me the same message, or it goes into 'save as' mode which lets me save the file (same name, and same location, but the original file has disappeared).
    I am connected to the server IP address through afp:// but have also tried cifs://. IT have removed all access to the server through smb://, so I cannot try this.
    ANY help is appreciated.

    With regard to the EPS issue, I think I may have found the source of the problem for SMB users: the Suitcase Fusion plug-in.
    Did you make any progress on these issues?

  • Illustrator breaks text at a point when importing from an EPS file?

    I am importing an EPS file from a statistical software. All text strings that belong together are in brackets ( ), so the EPS file is OK. When AI creates the chart it happens that the last glyph is a new and independent text string (text at a point).
    Is it possible to force AI to respect the structure of the EPS file.
    Thanks,
    Daniel

    No.
    You can only fix it afterwards.

  • How do you find out what the font type is when you open a .eps file

    I've been sent a logo in a .eps file and I need to edit. However I can't see what font type has been used!
    Thanks Claire

    Claire,
    You may also try here,
    http://www.identifont.com/
    http://www.whatfontis.com/
    Or ask in the Typography forum,
    http://forums.adobe.com/community/design_development/typography?view=discussions&start=0
    Edit: Hi elDudereno.

Maybe you are looking for

  • Send 100+ messages in a transaction

    How to send more than 100 brokered messages to Azure Service Bus within a Transaction? I know that TransactionScope does the trick but is limited to 100 messages. And I know that if I send the messages as a Batch operation, the total size of the mess

  • Z87-gd65 Troubles

    Hi guys, I'm new here but would like a big help. Spent a week putting my new build together and installed win8.1 on it, all OK, but no ethernet /lan working.  Nothing will work as regards installing drivers from CD, nor updated ones from site. If I r

  • Is there any ways to find the object that triggered the keyevent

    i am having difficulty in this part of keyevent iam almost struck here i want to know is there an possibility to find the object that triggreed the keyevent

  • Unable to move ALL my apps from ITunes Library to my new phone

    I just restrored my 4s from an old backup. My Lib has 75 aps but the new phone only pickedup up 44. Aps Syn is enabled. Please help.

  • Sneak Preview SAP NetWeaver 2004 - Error while re-installing (Step-4)

    Hi, Funny things happenning, Again got a problem while installing Sneak Preview, this time in Step-4 at Database instance creation. Here is the error log. Could someone help me in resolving the problem? ERROR 2005-12-25 12:58:29 The dbmcli call for a