Creating Picture file from text. HELP

If someone could point me in the right direction or give me a example; that would be Great! Thank you, in advance.
This is the case... I want to create a picture file based on the text file being read, either bipmap, jpg or any widely used picture file format. What the program will do is read a file and translate the file into a picture. Based on the parameters in the file the program will create a picture the picture will be both text and other symbols.
Thank you.

With javax.imageio it is very easy to save a BufferedImage, so the problem really is how to render text on a BufferedImage. Here's a short sample how one line of text can be saved into a .png image. Unfortunately laying out text, rendering multiple lines, deciding where the line should be broken etc is a little more complicated than rendering just a short bit of text, but there's a lesson on it in the Java2D tutorial at http://java.sun.com/docs/books/tutorial/2d/textandfonts/linebreakmeasure.html
and further information in the 2D graphics guide at http://java.sun.com/j2se/1.4.2/docs/guide/2d/spec/j2d-fonts.html#wp74623
It might also be possible to get a gui component like JTextArea to handle the text layout and rendering for you.import java.awt.Color;
import java.awt.Font;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import javax.imageio.ImageIO;
import javax.swing.*;
public class Text2PNG {
    public static void main(String[] args) throws Exception {
     // The text to render
     String text = "ABCDEFG abcdefg";
     // The font to use
     Font f = new Font("Dialog", Font.PLAIN, 24);
     // Find out the bounds of the rendered text when fractional metrics and
     // antialiasing is used:
     FontRenderContext cntxt = new FontRenderContext(null, true, true);
     GlyphVector glvec = f.createGlyphVector(cntxt, text);
     Rectangle bounds = glvec.getPixelBounds(cntxt, 0, 0);
     // Set up an image that has the same size as the rendered text:
     BufferedImage image = new BufferedImage(bounds.width, bounds.height,
          BufferedImage.TYPE_INT_RGB);
     Graphics2D g2d = (Graphics2D) image.getGraphics();
     g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                    RenderingHints.VALUE_FRACTIONALMETRICS_ON);
     g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                    RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
     // Fill the background of the image with white:
     g2d.setColor(Color.WHITE);
     g2d.fillRect(0, 0, image.getWidth(), image.getHeight());
     // Render the text on the image in black:
     g2d.setFont(f);
     g2d.setColor(Color.black);
     g2d.drawGlyphVector(glvec, -bounds.x, -bounds.y);
     // Save the image as PNG to text.png:
     ImageIO.write(image, "png", new java.io.File("text.png"));
     // // Show a preview of the image (optional)
     // JLabel jl = new JLabel(new ImageIcon(image));
     // JFrame jf = new JFrame("Text to PNG");
     // jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     // jf.getContentPane().add(jl);
     // jf.pack();
     // jf.setVisible(true);
}

Similar Messages

  • Creating INDD file from INX and visa versa

    Hi
    My task is to create a inx file from indd file and that was easy. I just use
    var myDocument = app.open(File(sourceFileName));
    //save INX
    myDocument.exportFile(ExportFormat.INDESIGN_INTERCHANGE, File(destinationFilePath+".inx"));
    but my problem is that I now have a more that one INDD file and one INDB file and client ask me to make INX file from it.
    (I;m just a developer and I never use InDesigner application at all so is it possible? and how?
    and than I have to form INX file create INDD file , text file and all Linking files in Links folder.
    I found a
    var myDocument = app.open(File(sourceFileName));
    myDocument.packageForPrint(myLinkFolder, false, true, false, true, true, true, "", false);
    but problem is that I got only INDD file and for some reason the newly create INND file has a name undifined_1.indd (I found that this is a file name that script foud from INX file ?!?) LInks file is empty.
    Is it possible that he create package and put all eps file there !?!

    I'm a designer not a developer, so I'm not sure I'll be helping but<br />the normal behavior when opening an INX file is creates an untitled<br />.indd file.  This is is typical.  I'm not sure how you would<br />automatically rename back to what it was previously. Have you tried<br />packaging the indd file BEFORE you make the INX file?  Also InDesign<br />has the ability to embed the images in the file or link them to<br />external files. You might check to see if that is done, by checking<br />the links pallet.  Unfortunately I'm not following what you're<br />starting goal and end goal is.  I'll be helpless with the programming<br />end, but any questions regarding how InDesign would typically do it,<br />I'm happy to help with.<br /><br />Rosie<br />Trying to learn scripting by osmosis (tucks her laptop under her pillow)<br /><br />On Wed, Feb 18, 2009 at 4:31 AM, lpastor74 <[email protected]> wrote:<br />> A new discussion was started by lpastor74 in<br /><br />> but problem is that I got only INDD file and for some reason the newly<br />> create INND file has a name undifined_1.indd (I found that this is a file<br />> name that script foud from INX file ?!?) LInks file is empty.<br />><br />> Is it possible that he create package and put all eps file there !?!<br />><br />> ________________________________<br />> View/reply at Creating INDD file from INX and visa versa<br />> Replies by email are OK.<br />> Use the unsubscribe form to cancel your email subscription.<br />><br />>

  • HOW TO CREATE PDF FILES FROM AUTOCAD 12

    I'M USING ACROBAT X TO CREATE PDF FILES FROM AUTOCAD 12 DRAWINGS.  THE PROGRAM RANDOMLY LEAVES OUT TEXT AND IMAGES.  IT ALSO STRUGGLES WITH TIFF, JPEG AND PDF IMAGE FILES EMBEDDED WITHIN THE AUTOCAD DRAWING.  THIS HAS BEEN AN ONGOING PROBLEM WITH ACROBAT.  I WAS HOPING THE UPGRADE TO  X WOULD ELIMINATE THE PROBLEM BUT IT HAS NOT.

    Hi Joao,
                    Verify these links hope it may helps...
    http://www.devx.com/xml/Article/16430/1954
    http://technopaper.blogspot.com/2008/06/using-xsl-fo-to-create-pdf-files.html
    http://www.ibm.com/developerworks/xml/library/x-xslfo/
    http://www.antennahouse.com/XSLsample/XSLsample.htm
    Regards,
    Anil.

  • FAQ: Creating PDF Files from FrameMaker v.6 & earlier Documents -- Why you should not use "save as PDF"! -- Windows & MacOS Only!

    An issue that has come up over and over again on several FrameMaker and Acrobat/PDF email lists as well on the corresponding Adobe User-to-User forums is that of creation of PDF files. FrameMaker 5.5.6 and 6 have what looks like a convenient feature that is supposed to allow you to create PDF files via simply saving the document as a PDF file. I have gone on record as advising end-users not to use this approach for reliable creation of PDF files from FrameMaker documents under Windows and MacOS with FrameMaker 6 and earlier. Why do I most vociferously offer this advice and why doesn't the problem get fixed? And how SHOULD you create PDF files from FrameMaker?
    GOOD NEWS
    I will start with the good news. The "next major version" of FrameMaker will indeed have "save as PDF" re-implemented in a manner that it will be as reliable as printing to the "Acrobat Distiller" printer instance under Windows or the "Create Adobe PDF" desktop printer under MacOS. I am personally working with the FrameMaker development organization to make sure this really happens and is fully and properly tested and debugged! Furthermore, this next major revision of FrameMaker, unlike FrameMaker 6, will come with a Distiller installer that will properly install the "Acrobat Distiller" printer instance under Windows and the "Create Adobe PDF" desktop printer on the Macintosh (of course assuring that the latest PostScript driver is also automatically and correctly installed).
    DON'T USE "SAVE AS PDF"
    But what's wrong with "save as PDF" as currently implemented?
    The following are some of the SYMPTOMS reported over the last few years by FrameMaker users that were traced back to use of "save as PDF" under FrameMaker:
    (1) No PDF file is produced at all, possibly with a log file showing not-readily apparent PostScript errors during distillation.
    (2) The PDF file "loses" color in images. All or some images (raster, bitmap images, NOT vector artwork) appear in the PDF file in grayscale.
    (3) The resultant PDF file is on the wrong paper size, i.e., the document's logical page size does not match the output page size as seen in Acrobat or Acrobat Reader.
    (4) Some or all text in the resultant PDF file is blotchy looking or overly bold.
    (5) Some or all text in the resultant PDF file cannot be searched or indexed.
    (6) Some or all text in the resultant PDF file appears in Courier or in some other substitution font.
    (7) Interword or intercharacter spacing is a bit irregular in the resultant PDF file.
    (8) Content is missing in the margin areas of the page, i.e. you cannot do full-page bleeds.
    (9) Some or all page content is missing (other than margin areas).
    (10) Relatively inefficient PDF is generated.
    If this list by itself isn't enough for you, please note that some of these symptoms are very subtle and may escape attention when the PDF is first viewed or printed. Oftimes, it is when one attempts to manipulate the PDF file in Acrobat or repurpose its content or even view or print on a system other than the one on which the PDF file was created, that some of these symptoms make themselves obnoxiously visible (or invisible in some cases I won't make any bad jokes here about graphic examples!).
    It is important to understand that FrameMaker does NOT have its own native ability to create PDF. Any and all PDF created from FrameMaker documents is actually done by creating PostScript via the PostScript driver and having the Acrobat Distiller create PDF from that PostScript. The only exception to this is creation of PDF via the Acrobat PDFWriter driver, which is likewise not recommended (see below).
    In order for "save as PDF" to work correctly, FrameMaker must do the equivalent of calling Printer Setup and selecting the "Acrobat Distiller" printer instance under Windows or the "Create Adobe PDF" desktop printer under MacOS followed by setting the driver's options correctly for paper size, page range, etc., followed by sending the proper commands to the driver to create PostScript.
    Contrary to popular belief, PostScript as generated by the Windows and MacOS PostScript drivers is VERY device-dependent. The information in the PPD file associated with a printer driver instance provides critical parameters for generation of PostScript including:
    Whether the printer supports color (Acrobat Distiller does)
    What PostScript language level is supported (Acrobat Distiller 4.x and Acrobat Distiller 5.x are both PostScript language level 3)
    Whether native TrueType support is available (Acrobat supports native TrueType as Type 42 fonts)
    Available binary communications (Acrobat Distiller supports pure binary and ASCII, but NOT TCP, TBCP, or PJL)
    Resident fonts (Acrobat Distiller doesn't really have resident fonts)
    Available paper sizes and custom paper size availability (Acrobat Distiller supports a wide range of predefined sizes and continually variable "custom" sizes up to 200" by 200")
    Margins / printable areas (for PDF and the Acrobat Distiller, there are no margins in which imaging is not permitted)
    Device resolution (Acrobat Distiller can be set to any value from 72 to 4000 dpi; as a convenience, the Acrobat Distiller PPD provides a series of values for use by the driver. Since there is no inherent "resolution" of a PDF file, this parameter is used only for purposes of allowing PostScript programs that query for such a value to be satisfied and for the driver to be able to communicate this value to the operating system and/or application as required.)
    Paper handling (totally irrelevant to Acrobat Distiller if input or output tray selection via "setpagedevice" is found in the PostScript stream, it is ignored by Acrobat Distiller)
    Thus, if the wrong printer driver instance is selected (i.e., it isn't associated with the Acrobat Distiller PPD file) or that driver instance is improperly configured, improper PostScript will result and one or more of the symptoms described above can occur. As currently implemented, FrameMaker depending upon version will not necessarily choose the correct printer driver instance and/or correctly parameterize the print job via driver setup options. In fact, FrameMaker 5,5,6 might even try to generate PDF via calling a PCL driver, FAX driver, or even a non-PostScript inkjet printer!
    DON'T USE PDFWRITER
    The Acrobat PDFWriter is a relic of older versions of Acrobat. In fact, it is no longer installed by default in the "easy install" or the "typical install" of Acrobat 5. It hasn't really be updated since Acrobat 3 and only supports PDF 1.2. It is a GDI (Windows) / QuickDraw (MacOS) driver that directly generates PDF without any intermediary PostScript. Since it is not a PostScript printer driver, applications cannot pass through EPS graphics and/or PDFMark information (used for a wide variety of purposes by FrameMaker). For EPS graphics, most applications will send the low resolution TIFF (or PICT) EPS header in lieu of the PostScript text, if they send anything at all, to the driver. Forget about links, structure, or any other PDF "goodies." Expect that PDFWriter will fully "bite the dust" in the next major version of Acrobat.
    SO HOW DO I GENERATE PDF FILES FROM FRAMEMAKER 6 & EARLIER?
    The ONLY method that is really reliable for producing PDF files with FrameMaker 6 and earlier requires the generation of PostScript via a properly set printer driver instance associated with the Acrobat Distiller PPD and distillation of the resultant PostScript by Acrobat Distiller.
    Case 1: FrameMaker and the Full Acrobat 4.05 or Acrobat 5.0x Products
    PDF file from a "chapter" -- print directly to the Acrobat Distiller printer instance (Windows) or the Create Adobe PDF desktop printer (MacOS) already installed by Acrobat. If you check the "Acrobat data" option, then make sure to UNcheck the "print to file" option that gets set at the same time. As a result, the driver will automatically send the generated PostScript to the Distiller for you and delete the intermediate PostScript when done.
    PDF file from a "book" -- print directly to the Acrobat Distiller printer instance with the "print to file" option checked (Windows) or the Virtual Printer desktop printer (MacOS) associated with the Distiller PPD (see details below under Case 2/MacOS). You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    In both the above sub-cases, the default driver options generally will be OK, but check on paper size and communication protocol (Use pure binary, not ASCII, for optimal performance AND no CTRL-D characters under Windows. Make sure to set Level 3 only and Binary under MacOS. Font inclusion "All" for Acrobat 4.05 and "None" for Acrobat 5 under MacOS.). With Acrobat 4.05, make sure you preset the Distiller to use the joboptions you want. With Acrobat 5, you can set this on a job-by-job basis via the driver printer setup interface (or print dialog on MacOS).
    Case 2: FrameMaker 6 and the Bundled Acrobat 4.05 Distiller
    Windows -- Create a new printer driver instance using the latest version of the Adobe Universal PostScript Driver Installer, downloadable from Adobe's web site AND the Acrobat Distiller PPD file (located in the XTRAS subdirectory of the Distiller directory). This driver instance should be set to print to the local port named "FILE:". Name this driver instance as "Acrobat Distiller". The default driver options generally will be OK, but check on paper size and communication protocol (use pure binary, not ASCII, for optimal performance AND no CTRL-D characters). Make sure you preset the Distiller to use the joboptions you want. Print directly to this Acrobat Distiller printer instance. Make sure that the "print to file" option is checked. You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    MacOS -- Install the latest version of AdobePS 8.7.x, downloadable from Adobe's web site. In FrameMaker, go to Page Setup and select the "Virtual Printer" and go to the "Virtual Printer" window pane. Select the Acrobat Distiller PPD file (located in the XTRAS subfolder of the Distiller folder). Print directly to the "Virtual Printer" (Make sure to set Level 3 only, Binary, and font inclusion "All".). Make sure you preset the Distiller to use the joboptions you want. You will need to manually process the resultant PostScript file through the Distiller (or use a "watched folder" arrangement).
    Case 3: Acrobat 3
    Acrobat 3 is not officially supported for the latest OS versions and I personally would no longer recommend its use for generation of PDF files given that Acrobat 5.0.5 is the current version of Acrobat.
    - Dov

    You're asking a lot of ancient Acrobat to work with an Office that never existed when it was made. "Just updated my office suite" is a massive change, and Window 8 didn't exist at that time either...

  • Howto make created folders/ files from one teacher, read only for other teachers?

    Hello there,
    as an admin @ school I was wondering how to make created folders/ files from one teacher, read only for other teachers?
     - In a 2008domain, created a group "teachers"
     - created a folder "teacher data" where all teachers have read/write permissions
    ideal,a teacher who make's a folder in "teacher data" should be the only oen who is able to add file's to that folder and dele that folder or files. Other teachers may be able to read the content of the folder.
    Is this possible to set up and how?
    many thanks.
    Nico.
    rds

    Hi Nico,
    You could set the permissions below to resolve the issue:
    For the root folder "teacher data": give the full control permission to CREATOR OWNER – "Subfolders and files only" and give the read/write permissions to the group "teachers"– "This folder only".
    Best Regards,
    Mandy 
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to create xml file from original

    I have this complicated xml and I want to search through it and make a new xml with only element I find that match. what is the best way to do this? the file
    is about 6mb and I want to read the whole file easily..should i load to database table and create a file from table? I have found issues reading the file..
    - <ArrayOfJobClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <JobClass>
    - <Triggers>
    - <TriggerClass>
    <ExpireActionType>Delete</ExpireActionType>
    <ExpireType>DateTime</ExpireType>
    <TriggerType>TimeType</TriggerType>
    - <TTime>
    <TimeTriggerType>Custom</TimeTriggerType>
    <IntervalType>Daily</IntervalType>
    <SpecificType>Days</SpecificType>
    <FirstLastType>First</FirstLastType>
    <IntervalValue>1</IntervalValue>
    <FirstLastWeekDay>Monday</FirstLastWeekDay>
    <InitDate>2009-05-04T14:17:05.40625-07:00</InitDate>
    - <IntervalDays>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>
    <boolean>false</boolean>

    You can load it in the database in an XMLType table (Object-Relational or Binary XML storage), use XQuery on the XML content and then write back the result to a file.
    Or, you might just use an external processor (XSLT or XQuery).
    If you want to stay in the Oracle world, you can use :
    - For XSLT : $ORACLE_HOME/bin/oraxsl (it's a wrapper for the java XSLT engine)
    - For XQuery : the java XQuery API
    Personally, I sometimes use the Saxon XSLT and XQuery processor, quite efficient.
    Here's a simplistic example with oraxsl utility :
    emp.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <emps>
      <emp id="7369">
        <name>SMITH</name>
        <job>CLERK</job>
        <salary>800</salary>
      </emp>
      <emp id="7499">
        <name>ALLEN</name>
        <job>SALESMAN</job>
        <salary>1600</salary>
      </emp>
      <emp id="7521">
        <name>WARD</name>
        <job>SALESMAN</job>
        <salary>1250</salary>
      </emp>
      <emp id="7566">
        <name>JONES</name>
        <job>MANAGER</job>
        <salary>2975</salary>
      </emp>
      <emp id="7654">
        <name>MARTIN</name>
        <job>SALESMAN</job>
        <salary>1250</salary>
      </emp>
    </emps>
    emp.xsl
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:template match="text()"/>
    <xsl:template match="emps/emp[job='SALESMAN']">
      <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:stylesheet>Applying the transformation to search and extract all "salesmen" :
    D:\ORACLE\test>%ORACLE_HOME%\bin\oraxsl emp.xml emp.xsl result.xml
    D:\ORACLE\test>type result.xml
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <emp id="7499">
        <name>ALLEN</name>
        <job>SALESMAN</job>
        <salary>1600</salary>
      </emp><emp id="7521">
        <name>WARD</name>
        <job>SALESMAN</job>
        <salary>1250</salary>
      </emp><emp id="7654">
        <name>MARTIN</name>
        <job>SALESMAN</job>
        <salary>1250</salary>
      </emp>

  • Hel with modifying cs5/6 script...create anchored frames from text

    hello
    I have one great time saver script for cs5 for create anchored frames from text tagged with/or charachter style/paragraph style. This work in cs6 but have some "bugs" for me. Script need to be compatible with InDesign CS6.
    1. script in original (look bellow) create text frame which is fitted to lenght of the text. I make change and change 466 line:
    AnchoredTextFrame.fit(FitOptions.FRAME_TO_CONTENT);
    now frame is wide as I write in check box, good. But frame not resize to lenght of the text so I add after above lines 466-470:
        var FO = FitOptions.FRAME_TO_CONTENT,
        tfs = ([]).concat.apply([], app.activeDocument.stories.everyItem().textContainers),
        t, i = tfs.length;
    while( i-- ) (t=tfs[i]).overflows && ( t.locked || t.fit(FO) );
    now all is ok but is here better way to make this to work? Simply, i want to spec text frame width in dialog box, frame will resize only verticaly in direction to amount text in frame. I dont want any overset text.
    2. One "bug". For some reason script alter paragraph style of other text which is not subject to be cutted in anchored frame.
    How to resolve this?
    #targetengine "session"
              Automating anchored object creation
              Version: 2
        Script by Thomas Silkjær
              http://indesigning.net/
    Модификация Б. Кащеев, www.adobeindesign.ru
    Скрипт предназначен для создания привязанных фреймов из текста, отформатированного
    каким-либо абзацным или символьным стилем. Эти стили задаются пользователем в диалоговом
    окне скрита. Там же необходимо задать объектный стиль для привязанного фрейма, в котором
    пользователь должен заранее задать оформление и параметры привязки. Далее необходимо
    указать ширину привязанного фрейма, а его высота будет рассчитана автоматически исходя из
    объема текста. При вводе дробных значений ширины привязанного фрейма в качестве
    разделителя целой и дробной части следует использовать не запятую, а точку, следуя западным
    стандартам разработчиков программы  Adobe InDesign. Первоначально идея и скрипт по созданию
    привязанных фреймов принадлежит Thomas Silkjær для версии ID CS4. C появлением версий CS5
    и CS5.5 скрипт перестал в них выполняться, да и в версии CS4 не всегда корректно работал.
    Анализируя недочеты скрипта в данной его версии были исправлены ошибки и внесены
    функциональные дополнения исходя из понимания задачи автором модификации. Добавлена
    возможность выбора стилей, если они они находятся в группах (папках), возможность выбора
    единиц измерения из выпадающего списка, изменены GREP-выражения для поиска текста,
    область действия скрипта ограничена материалом (Story), а не документом.
    var myMeasureUnits = ["Milimeters","Centimeters","Points","Inches", "Picas", "Ciceros"];
    var selectUnits;
    var pStyleIndex = null;
    var cStyleIndex = null;
    var oStyleIndex = null;
    var myH, myW;
    function main()
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
              if (app.documents.length == 0)
                        alert ("Document is not open. Open document first");
                        return;
        var myParaStyleList = myGetParagraphStyleNames();
        var myCharStyleList = myGetCharacterStyleNames();
        var myObjStyleList = myGetObjStyleNames();
        if(app.selection.length && app.selection[0].hasOwnProperty("baseline"))
            var myStory = app.selection[0].parentStory;
            var myWin = myDialog(myParaStyleList, myCharStyleList, myObjStyleList);
            if ( myWin.show()  == 1 )
                var myDocument = app.activeDocument
                with (myDocument.viewPreferences){
                    // Сохраняем старые единицы измерения в переменных myOldXUnits, myOldYUnits
                    var myOldXUnits = horizontalMeasurementUnits;
                    var myOldYUnits = verticalMeasurementUnits;
                    // Устанавливаем новые единицы измерения
                    switch(selectUnits)
                        case 0:                   
                            horizontalMeasurementUnits = MeasurementUnits.millimeters;
                            verticalMeasurementUnits = MeasurementUnits.millimeters;
                            break;
                        case 1:
                            horizontalMeasurementUnits = MeasurementUnits.centimeters;
                            verticalMeasurementUnits = MeasurementUnits.centimeters;
                            break;
                        case 2:
                            horizontalMeasurementUnits = MeasurementUnits.points;
                            verticalMeasurementUnits = MeasurementUnits.points;
                            break;                  
                        case 3:
                            horizontalMeasurementUnits = MeasurementUnits.inches;
                            verticalMeasurementUnits = MeasurementUnits.inches;
                            break;
                        case 4:
                            horizontalMeasurementUnits = MeasurementUnits.picas;
                            verticalMeasurementUnits = MeasurementUnits.picas;
                            break;
                        case 5:
                            horizontalMeasurementUnits = MeasurementUnits.ciceros;
                            verticalMeasurementUnits = MeasurementUnits.ciceros;
                            break;
                        default: break;
                    } // switch
                if(cStyleIndex == null)
                {/*поиск по стилю абзаца*/
                    var pStyle = getParagraphStyleByName(myParaStyleList[pStyleIndex]);
                    resetGREPfindChange();
                    app.findGrepPreferences.appliedParagraphStyle = pStyle;
                    app.findGrepPreferences.findWhat = NothingEnum.nothing;
                else //
                    // поиск по стилю символов
                    var cStyle = getCharacterStyleByName(myCharStyleList[cStyleIndex]);
                    resetGREPfindChange();
                    app.findGrepPreferences.appliedCharacterStyle = cStyle;
                    //app.findGrepPreferences.findWhat = ".+";
                    app.findGrepPreferences.findWhat = NothingEnum.nothing;
                var foundItems = myStory.findGrep();
                if(!foundItems.length) {
                    alert("Found the text to be placed in a linked frames"); exit();
                //alert(foundItems.length);
                //alert (foundItems[0].contents)
                //alert (foundItems[1].contents)
                var oStyle = getObjectStyleByName(myObjStyleList[oStyleIndex]);
                for(var i = foundItems.length-1; i >=0; i--)
                    //alert (foundItems[i].contents)
                    createAnchoredFrame(foundItems[i], oStyle);
                with (myDocument.viewPreferences){
                    try{
                        horizontalMeasurementUnits = myOldXUnits;
                        verticalMeasurementUnits = myOldYUnits;
                    catch(myError){
                        alert("Unable to return to the original unit");
            } //if ( myWin.show()
        } //if(app.selection.length && app.selection[0].hasOwnProperty("baseline"))
        else
            alert("Place the cursor in the text and run the script again")
    } // main
    function myGetParagraphStyleNames()
    // Получаем список стилей абзацев
              var curGroup;
              var curGroupName;
              var curNameInGroup;
              var myParagraphStyleNames = app.activeDocument.paragraphStyles.everyItem().name;
              myParagraphStyleNames.shift(); // удаление стиля No Paragraph Style
              var paraGroups = app.activeDocument.paragraphStyleGroups;
              var paraGroupsLen = paraGroups.length;
              for(var i = 0; i < paraGroupsLen; i++) {
                        curGroup = paraGroups[i];
                        curGroupName = paraGroups[i].name;
                        curGroupStyleNames = curGroup.paragraphStyles.everyItem().name
                        for (j=0; j< curGroupStyleNames.length; j++)
                                  curNameInGroup = curGroupName +":"+ curGroupStyleNames[j];
                                  myParagraphStyleNames.push(curNameInGroup);
              return myParagraphStyleNames;
    function myGetCharacterStyleNames()
    // Получаем список символьных стилей
              var curGroup;
              var curGroupName;
              var curNameInGroup;
              var myCharacterStyleNames = app.activeDocument.characterStyles.everyItem().name;
              myCharacterStyleNames.shift(); // удаление стиля None
              var charGroups = app.activeDocument.characterStyleGroups;
              var charStyleGroupLen = charGroups.length;
              for(var i=0; i < charStyleGroupLen; i++)
                        curGroup = charGroups[i];
                        curGroupName = charGroups[i].name;
                        curGroupStyleNames = curGroup.characterStyles.everyItem().name;
                        for (j=0; j< curGroupStyleNames.length; j++)
                                  curNameInGroup = curGroupName +":"+ curGroupStyleNames[j];
                                  myCharacterStyleNames.push(curNameInGroup);
              } //for
              return myCharacterStyleNames;
    } // fnc
    function myGetObjStyleNames()
        var curGroup;
              var curGroupName;
              var curNameInGroup;
              var myObjStyleNames = app.activeDocument.objectStyles.everyItem().name;
        myObjStyleNames.shift();
        var objGroups = app.activeDocument.objectStyleGroups;
        var objStyleGroupLen = objGroups.length;
        for(var i=0; i < objStyleGroupLen; i++)
                        curGroup = objGroups[i];
                        curGroupName = objGroups[i].name;
                        curGroupStyleNames = curGroup.objectStyles.everyItem().name;
                        for (var j=0; j< curGroupStyleNames.length; j++)
                                  curNameInGroup = curGroupName +":"+ curGroupStyleNames[j];
                                  myObjStyleNames.push(curNameInGroup);
              } //for
        return myObjStyleNames;
    } // fnc
    function myDialog(myParaStyleList, myCharStyleList, myObjStyleList)
        var myDialog = new Window('dialog', 'Create anchored text frames');
        this.windowRef = myDialog;
              myDialog.orientation = "column";
        myDialog.alignChildren = ['fill', 'fill'];
        // добавляем панель 1 с элементами управления
        myDialog.Pnl1 = myDialog.add("panel", undefined, "Move the text in linked frames");
              myDialog.Pnl1.orientation = "column";
        myDialog.Pnl1.alignChildren = "left";
        myDialog.Pnl1.pstyle = myDialog.Pnl1.add('checkbox', undefined, "Text with the paragraph style");
        myDialog.Pnl1.pstyle.value = false;
        myDialog.Pnl1.dropdownParaStyle = myDialog.Pnl1.add("dropdownlist", undefined, myParaStyleList);
        myDialog.Pnl1.dropdownParaStyle.title = "Select the paragraph style ";
        myDialog.Pnl1.dropdownParaStyle.minimumSize = [250,20];
        myDialog.Pnl1.dropdownParaStyle.enabled = false;
        myDialog.Pnl1.dropdownParaStyle.selection = 0;
        if(myCharStyleList.length)
            myDialog.Pnl1.сstyle = myDialog.Pnl1.add('checkbox', undefined, "Text with character style");
            myDialog.Pnl1.сstyle.value = false;
            myDialog.Pnl1.dropdownCharStyle = myDialog.Pnl1.add("dropdownlist", undefined, myCharStyleList );
            myDialog.Pnl1.dropdownCharStyle.title = "Select the character style ";
            myDialog.Pnl1.dropdownCharStyle.minimumSize = [250,20];
            myDialog.Pnl1.dropdownCharStyle.enabled = false;
            myDialog.Pnl1.dropdownCharStyle.selection = 0;
            myDialog.Pnl1.pstyle.onClick = function()
                if(this.value) {
                    myDialog.Pnl1.dropdownParaStyle.enabled = true;
                    myDialog.Pnl1.dropdownCharStyle.enabled = false;
                    myDialog.Pnl1.сstyle.value = false;
                else
                    myDialog.Pnl1.dropdownParaStyle.enabled = false;
                    myDialog.Pnl1.dropdownCharStyle.enabled = true ;
                    myDialog.Pnl1.сstyle.value = true;
            }// fnc
            myDialog.Pnl1.сstyle.onClick = function()
                if(this.value)
                    myDialog.Pnl1.dropdownCharStyle.enabled = true;
                    myDialog.Pnl1.dropdownParaStyle.enabled = false;
                    myDialog.Pnl1.pstyle.value = false;
                else
                    myDialog.Pnl1.dropdownCharStyle.enabled = false;
                    myDialog.Pnl1.dropdownParaStyle.enabled = true ;
                    myDialog.Pnl1.pstyle.value = true;
            }// fnc
        }//  if(myCharStyleList.length)
        else
            myDialog.Pnl1.pstyle.onClick = function()
                if(this.value)
                    myDialog.Pnl1.dropdownParaStyle.enabled = true;
                else
                    myDialog.Pnl1.dropdownParaStyle.enabled = false;
    //  Вторая панель
        myDialog.Pnl2 = myDialog.add("panel", undefined, "Parameters of the text frame");
              myDialog.Pnl2.orientation = "column";
        myDialog.Pnl2.alignChildren = "left"; 
        myDialog.Pnl2.dropdownObjStyle = myDialog.Pnl2.add("dropdownlist", undefined, myObjStyleList );
        myDialog.Pnl2.dropdownObjStyle.title = "Select an object style ";
        myDialog.Pnl2.dropdownObjStyle.minimumSize = [250,20];
        myDialog.Pnl2.dropdownObjStyle.enabled = true;
        myDialog.Pnl2.dropdownObjStyle.selection = 0;
        myDialog.Pnl2.Group1 = myDialog.Pnl2.add( "group" );
        myDialog.Pnl2.Group1.stxt1 = myDialog.Pnl2.Group1.add("statictext", undefined, "The width of the text frame");
        myDialog.Pnl2.Group1.etxt = myDialog.Pnl2.Group1.add("edittext", undefined, "40");
        myDialog.Pnl2.Group1.etxt.characters = 10;
        myDialog.Pnl2.Group1.dropdownMeasurementUnits = myDialog.Pnl2.Group1.add("dropdownlist", undefined, myMeasureUnits );
        myDialog.Pnl2.Group1.dropdownMeasurementUnits.maximumSize = [80,20];
        myDialog.Pnl2.Group1.dropdownMeasurementUnits.selection = 0;
        //myDialog.Pnl2.Group1.stxt2 = myDialog.Pnl2.Group1.add("statictext", undefined, "mm ");
        /*myDialog.Pnl2.Group2 = myDialog.Pnl2.add( "group" );
        myDialog.Pnl2.Group2.stxt1 = myDialog.Pnl2.Group2.add("statictext", undefined, "Высота привязанного фрейма  ");
        myDialog.Pnl2.Group2.etxt = myDialog.Pnl2.Group2.add("edittext", undefined, "30");
        myDialog.Pnl2.Group2.etxt.characters = 10;
        //myDialog.Pnl2.Group2.stxt2 = myDialog.Pnl2.Group2.add("statictext", undefined, "mm ");*/
        myDialog.Pnl2.stxt1 = myDialog.Pnl2.add("statictext", undefined, "Attention! When you enter fractional values as");
        myDialog.Pnl2.stxt2 = myDialog.Pnl2.add("statictext", undefined, "the decimal part, should be used");
        myDialog.Pnl2.stxt3 = myDialog.Pnl2.add("statictext", undefined, "point, not comma.");
        myDialog.Pnl2.stxt1.graphics.foregroundColor = myDialog.Pnl2.stxt1.graphics.newPen (myDialog.Pnl2.stxt1.graphics.PenType.SOLID_COLOR, [1, 0, 0, 1], 1);
        myDialog.Pnl2.stxt2.graphics.foregroundColor = myDialog.Pnl2.stxt2.graphics.newPen (myDialog.Pnl2.stxt2.graphics.PenType.SOLID_COLOR, [1, 0, 0, 1], 1);
        myDialog.Pnl2.stxt3.graphics.foregroundColor = myDialog.Pnl2.stxt3.graphics.newPen (myDialog.Pnl2.stxt3.graphics.PenType.SOLID_COLOR, [1, 0, 0, 1], 1);
        // --------- кнопки --------------
        var myGroup = myDialog.add( "group" );
        myGroup.orientation = 'row';
        myGroup.alignChildren = ['fill', 'fill']; 
        myGroup.okButton = myGroup.add( "button", undefined, "OK" );
        myGroup.okButton.onClick = function()
            if(myCharStyleList.length) // есть символьные стили в документе
                if(!myDialog.Pnl1.pstyle.value && !myDialog.Pnl1.сstyle.value)
                    alert("You must select a paragraph style or character style");
                    return ;
                if(myDialog.Pnl1.pstyle.value) { pStyleIndex= myDialog.Pnl1.dropdownParaStyle.selection.index; cStyleIndex = null;}
                else {cStyleIndex = myDialog.Pnl1.dropdownCharStyle.selection.index; pStyleIndex=null; }
            else // нет символьных стилей
                if(!myDialog.Pnl1.pstyle.value)
                    alert("You must select a paragraph style");
                    return;
                pStyleIndex = myDialog.Pnl1.dropdownParaStyle.selection.index;
                cStyleIndex = null;
            } //  else // нет символьных стилей
           oStyleIndex = myDialog.Pnl2.dropdownObjStyle.selection.index;
           if(myDialog.Pnl2.Group1.etxt.text =="")
               alert("Enter the width of the text frame");
               return;
            else
                myW = myDialog.Pnl2.Group1.etxt.text;
                myH = myW;
            /*if(myDialog.Pnl2.Group2.etxt.text == "")
                alert("Введите высоту привязанного фрейма");
                return;
            else
                myH = myDialog.Pnl2.Group2.etxt.text;
           selectUnits = myDialog.Pnl2.Group1.dropdownMeasurementUnits.selection.index;
            myDialog= this.window.close( 1 );
        myGroup.cancelButton = myGroup.add( "button", undefined, "Cancel" );
        myGroup.cancelButton.onClick = function() { myDialog = this.window.close( 0 ); }
        myDialog.Pnl3 = myDialog.add("panel", undefined, "");
        myDialog.Pnl2.alignChildren = "left";
        myDialog.Pnl3.stxt = myDialog.Pnl3.add("statictext", undefined, "(с) Thomas Silkjær        (с) Борис Кащеев, www.adobeindesign.ru ");
        return myDialog;   
    } // fnc
    function getParagraphStyleByName(myStyleName)
              var DocParaStyles = app.activeDocument.paragraphStyles;
              var DocParaGroups = app.activeDocument.paragraphStyleGroups;
              myStyleName = ""+myStyleName;
              var pos = myStyleName.indexOf(":")
              if(pos == -1)
              // стиль не в группе
              var myStyle = DocParaStyles.item(myStyleName);
                        return myStyle;
              } //if
              else
                        var myGroupAndStyleNames = myStyleName.split(":")
                        var myGroupName = myGroupAndStyleNames[0];
                        var myStyleName = myGroupAndStyleNames[1];
                        var myGroup =DocParaGroups.item(myGroupName);
                        return myGroup.paragraphStyles.item(myStyleName);
    } // fnc
    function getCharacterStyleByName(myStyleName)
              var DocChStyles = app.activeDocument.characterStyles;
              var DocCharGroups = app.activeDocument.characterStyleGroups;
              // Есть ли в имени полученного символьного стиля двоеточие? (двоеточие разделяет название группы стилей и название стиля)
              myStyleName = String (myStyleName);
              var pos = myStyleName.indexOf(":");
              if(pos == -1)
              // стиль не в группе
                        return DocChStyles.item(myStyleName)
              } //if...
              else
              {// Стиль в какой-то группе
                        var myGroupAndStyleNames = myStyleName.split(":")
                        var myGroupName = myGroupAndStyleNames[0];
                        var myStyleName = myGroupAndStyleNames[1];
                        var myGroup = DocCharGroups.item(myGroupName);
                        return myGroup.characterStyles.itemByName(myStyleName);
              } // else
    } // fnc()+
    function getObjectStyleByName(myStyleName)
        var DocObjStyles = app.activeDocument.objectStyles;
        var DocCObjGroups = app.activeDocument.objectStyleGroups;
        myStyleName = String (myStyleName);
        var pos = myStyleName.indexOf(":");
        if(pos == -1)
              // стиль не в группе
                        return DocObjStyles.item(myStyleName);
              } //if...
        var myGroupAndStyleNames = myStyleName.split(":");
        var myGroupName = myGroupAndStyleNames[0];
        var myStyleName = myGroupAndStyleNames[1];
        var myGroup = DocObjGroups.item(myGroupName);
                        return myGroup.objectStyles.itemByName(myStyleName);
    } //fnc
    function resetGREPfindChange()
        app.changeGrepPreferences = NothingEnum.nothing;
        app.findGrepPreferences = NothingEnum.nothing;
        app.findChangeGrepOptions.includeFootnotes = false;
        app.findChangeGrepOptions.includeHiddenLayers = false;
        app.findChangeGrepOptions.includeLockedLayersForFind = false;
        app.findChangeGrepOptions.includeLockedStoriesForFind = false;
        app.findChangeGrepOptions.includeMasterPages = false;
    function createAnchoredFrame(myText, myObjStyle)
        var myGeometricBounds = [];
        var myInsertionPoint = myText.insertionPoints[0];
        myInsertionPoint.select;
        var AnchoredTextFrame = myInsertionPoint.textFrames.add();
        myGeometricBounds = AnchoredTextFrame.geometricBounds;
        //alert(parseFloat(myH) + " " + parseFloat(myW))
        myGeometricBounds[2] = myGeometricBounds[0] + parseFloat(myH);
        myGeometricBounds[3] = myGeometricBounds[1] + parseFloat(myW);
        AnchoredTextFrame.geometricBounds = myGeometricBounds;
        AnchoredTextFrame.anchoredObjectSettings.anchoredPosition = AnchorPosition.anchored;
        myText.move(LocationOptions.before, AnchoredTextFrame.texts[0]);
        AnchoredTextFrame.appliedObjectStyle = myObjStyle;
        AnchoredTextFrame.fit(FitOptions.CONTENT_TO_FRAME);
        var FO = FitOptions.FRAME_TO_CONTENT,
        tfs = ([]).concat.apply([], app.activeDocument.stories.everyItem().textContainers),
        t, i = tfs.length;
    while( i-- ) (t=tfs[i]).overflows && ( t.locked || t.fit(FO) );
    } //fnc
    main();

    Hi Cari,
    I did create a new user account (admin level) and InDesign works like a charm.
    When I went back to the other account, plug-ins gone, I deleted the prefs and caches, restarted and still everything is crashing as before.
    At least I am working on one account and I will contiue to troubleshoot on the other account. And at some point either the new account will crash or the old account will work and I will go from there.
    Thanks for the info about Mac remembering info. Always trying to be helpful these Macs.
    And thanks for getting at least into a workable space!!! I am supremely grateful!

  • How do I pick up a picture file from PC

    How do I select and download a picture file from my PC to the iPad please

    use use itunes to sync the photos from pc to device.
    syncing itunes windows
    first open itunes on windows computer
    there's a small shaded box in upper left corner click it and show menu bar
    now go under view and show side bar
    go under help and check for updates (11.1.3 current) - update if needed
    plug in iphone (or ipad, ipod ect..)
    when the device shows up in sidebar click on the name of device not the arrow
    this opens up a summary page
    across top says info, apps, music, photos, ect...
    click on what you want to sync ie photos
    check the top box that says sync photos select -where and what photos you want
    now apply or sync at bottom
    Peace, Clyde
    you can also email a pic to yourself open on ipad and save to ipad
    Peace, Clyde

  • How to create pdf files with text field data

    how to create pdf files with text field data

    That looks like it should work, but it doesn't.
    I opened the PDF I had created from Word in Acrobat (X Pro). Went to File > Properties. Selected "Change Settings". I then enabled "Restrict editing...", set a password, set "Printing Allowed" to "none", "Changes Allowed" to "none", and ensured that "Enable copying of text..." was disabled.
    I saved the PDF file, closed Acrobat, opened the PDF in Reader, and I was still able to select text and graphical objects.
    I reopened the PDF in Acrobat, and the document summart still shows everything as allowed. When I click on "show details" (from File > Properties) it shows the correct settings.
    Any ideas?

  • Disable "always do this for Picture files from device name " checkbox

    Bluetooth users should know well that as you send a file from your remote device to your laptop, there will be a notification on the lower right side of the screen. As you click the notification, it will show a popup window asking for your action.
    Now my problem is I seemed to have ticked the checkbox stating "Always do this for Picture files from <my handphone>" while transferring pictures from my handphone to the laptop. I clicked save in folder: <directory>. Now, every time
    I transfer pictures to my laptop through bluetooth, it becomes automatically saved into the <directory> and I regret it, I want it to let me choose where to save the file again like previously. How should I do that?

    Hi,
    Do we have a bluetooth manager in use?
    If yes, check here:Enabling windows 7 to allow bluetooth file transfers without confirmation
    Regarding receive files from bluetooth, Windows 7 will always provide the steps below:
    Transfer Files via Bluetooth Between Phones & Windows 7 PCs
    Please verify if we can do some changes on the phone side.
    Best regards
    Michael
    If you have any feedback on our support, please click
    here.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Creat VOB files From FC Pro Timline or Compressor

    Is it possible to create DVD VOB files from the timeline of FC Pro or Compressor?
    This is feature that is available in Edius, is there anything similar in FC pro or Compressor?

    Hi,
    There is no direct way to create VOB files from FCP nor Compressor but you may use DVD Studio Pro.
    1- Export your sequence from FCP using "Export via Compressor..."
    2- In Compressor, drag from the settings tab a setting that suits your needs (ex :Apple>DVD>Best Quality 90 minutes)
    3- In DVDSP import the resulting files (m2v and ac3) in the" ressources tab", drag those 2 files in the "track 1" icon of the graphical tab, right-click and choose "first play".
    Then, you just have to buid a project (ie a VIDEO_TS folder containing your VOB files) using Option-Command-C (File>advanced burn>build)
    Hope it helps.
    Olivier

  • Create Executeable File From .class

    Hi All,
    I want to create executable file from .class. Is there any solution so that it should create only windows Dependent executable file so that it has to use windows DLL for all api calls.
    Regards
    Srikanth Addepalli

    What he is saying is you will want to make your
    .class -> .jar first. from here you can implement a
    variety of tools like
    http://www.excelsior-usa.com/articles/java-to-exe.html
    http://www.regexlab.com/en/jar2exe/
    http://jsmooth.sourceforge.net/
    Those are all free however this one isn't
    http://www.bestvistadownloads.com/software/t-free-jar2
    exe-standard-edition-download-lmdepovu.htmlThanks for Reply.
    But Every software you specified here is indirectly using the Java virtual Machine for execution.I need a software such a way that i should run without help of JVM.
    regards
    Srikanth Addepalli

  • Can you transfer picture files from an older version of aperture to aperture 3?

    Can you transfer picture files from an older version of aperture to aperture 3?

    Well, you didn't give any information on your Mac, your OS version, transfer pics from where to where, or anything else, so guessing is the best anyone can do at this point: you should be able to simply using drag and drop.

  • Creating XML file from Java Bean

    Hi
    Are there any standard methods in Java 1.5 to create XML file from java bean,
    i can use JAXB or castor to do so,
    But i would like to know if there is any thing in java core classes,
    I have seen XMLEncoder, but this is not what i want.
    Any ideas
    Ashish

    Marshall JavaBean to an XML document with JAXB or XMLBeans.

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

Maybe you are looking for

  • How to create an new column from ordered pairs

    Hi, Wondering if anyone can help this problem. I am analyzing network traffic between a PC and a Server. I can easily get a count of packets in each direction, PC1 to Server1 and the return path, Server 1 to PC1. But want I really want is a count of

  • I can't activate iMessages or Facetime on my 4s after updating to ios 8

    I updated my 4s finally and now I'm unable to activate iMessages or Facetime. It tells me it could not sign in. Please check your network connection and try again. Any ideas on how to correct?

  • [CUPS] Documents print with no margin on top of the page

    Hello people! I'm having a weird issue when I print documents. Whatever I print, from whatever application I print, it seems that the top margin is reduced. For instance, I have PDF documents with a one-inch top margin. The margin appears to be okay

  • Ant error - Unrecognized option option_name

    This post is for future generations... After a couple of months oа quite stable work my Ant script has started to fail with the following error [javac] Unrecognized option: -J-Xmx256m [javac] Could not create the Java virtual machine.After digging up

  • Can't seem to get all the bookmark folders in alfabetical order

    I have tried just about everything to get my bookmark folders in to alphabetical order most are right but at the bottom of the list there are quit a few folders that are not. I have tried the organize bookmark command than the view than sort than by