Adding formatted text in frame

Hi,
im trying to add text with differents formatting styles (e.g. font, size, color) which is not seperated by a space:
An example:
// "frame" is a given textframe
frame.parentStory.insertionPoints.item(-1).contents = "text1";
frame.parentStory.words.lastItem().appliedFont= "Arial";
frame.parentStory.words.lastItem().pointSize = 10";
frame.parentStory.insertionPoints.item(-1).contents = "text2";
frame.parentStory.words.lastItem().appliedFont= "Times New Roman";
frame.parentStory.words.lastItem().pointSize = 12";
After this, "text1text2" is formatted in "Times New Roman., 12Pts".
I tried to seperate "text1" and "text2" with "SpecialCharacters.hairSpace", but this did not help.
Have someone an idea?
Thanks!!

Use character ranges rather than words:
frame.parentStory.insertionPoints.item(-1).contents = "text1";
frame.parentStory.words.lastItem().appliedFont= "Arial";
frame.parentStory.words.lastItem().pointSize = 10;
endIndex = frame.parentStory.characters.item(-1).index;
frame.parentStory.insertionPoints.item(-1).contents = "text2";
frame.parentStory.characters.itemByRange(endIndex+1, frame.parentStory.characters.item(-1).index).appliedFont= "Times New Roman";
frame.parentStory.characters.itemByRange(endIndex+1, frame.parentStory.characters.item(-1).index).pointSize = 12;
.. although in this case it's easier to first change the formatting of the last insertion point and then insert the text:
frame.parentStory.insertionPoints.item(-1).appliedFont= "Arial";
frame.parentStory.insertionPoints.item(-1).pointSize = 10;
frame.parentStory.insertionPoints.item(-1).contents = "text1";
frame.parentStory.insertionPoints.item(-1).appliedFont= "Times New Roman";
frame.parentStory.insertionPoints.item(-1).pointSize = 12;
frame.parentStory.insertionPoints.item(-1).contents = "text2";

Similar Messages

  • Need help with adding formatted text and images to Crystal Report?

    Here's my scenario:
    I have a customer statement that's generated as a crystal report and that has a placeholder for advertisement. The advertisement is mixture of formatted text and images. Until now we only had one advertisement that was always used on the report. The new requirement is that we would have a pool of hundreds of advertisements and would need to display one specific advertisement on the customer statement based on various marketing criteria. They key is that the advertisement content will be determined programmatically and cannot be hardcoded into the report. I'm using Crystal2008 with .net SDK.
    Here are the solutions I thought of, but I'm still rather lost and would appreciate your help/opinion.
    1) Pass HTML or RTF to the report
    Not really sure if this is possible and how to get it done. Also how would I pass in images? Would display formatting be reliable when exporting to PDF?
    2) Create each add as a subreport and append it programatically
    I actually have this working, but I only know how to append a new section to the end of the report and then load the subreport to the section. I have no other controll of the placement. Is there a way to dynamically load a subreport to a predefined section in the main report? How about adding a dummy subreport in the main report as a placeholder and then replacing it with a different subreport? How could I do this?
    3) Pass an Image to the report
    I would create each advertisement as an image and then would somehow add the image to the report. How would I load the image and control the placement? Could I somehow define a placeholder for the image in the main report-maybe a dummy image to be replaced?
    Thank you.

    Hello Pavel,
    I would got the third way.
    You can use dynamic images in your report.
    Just by changing the URL to the image the image can be changed.
    Please see the [Crystal Manual|http://help.sap.com/businessobject/product_guides/cr2008/en/xir3_cr_usergde_en.pdf] and search for images.
    or directly here
    [Setting a Dynamic Graphic Location Path on an Image Object|https://boc.sdn.sap.com/node/506]
    [Dynamic image and HTTP://|https://boc.sdn.sap.com/node/3646]
    [codesample for .NET|https://boc.sdn.sap.com/node/6000]
    Please also use
    [Crystal Reports 2008 SDK Documentation and Sample Code|https://boc.sdn.sap.com/developer/library/CR2008SDK]
    [Crystal Reports 2008 .NET SDK Tutorial Samples|https://boc.sdn.sap.com/node/6203]
    Hope this helps
    Falk

  • Adding & formatting text in Acrobat Pro 8

    Summary:
    I have just upgraded from Acrobat 5 to Acrobat Professional 8. In acrobat 5 it is super easy to add new text and format to desired style, color, size, etc...
    I can not for the life of me figure out how to ADD text that I can format with font styles, size and color. (not to be confused with formatting pre-exiting text on a page) I have looked at the typewriter tool and text box tool. The text box tool appears to allow bold, strike, italics, but does not allow to resize, change color or change font style.
    Anyone know how to do this? I can't imagine this feature no longer available in such a dynamic version.
    Thanks!

    Jodi,
    You have posted to the wrong forum - Acrobat can be found at :
    http://www.adobeforums.com/cgi-bin/webx/.ee6b2ed/ if using Mac
    or
    http://www.adobeforums.com/cgi-bin/webx/.ee6b2f2/ if using Windows

  • Carry over formatting to the next page without adding a text box

    I've written 15 books on the old pages and had no trouble carrying the formatting to the next page without adding a page or adding a text box to the added page.  I just kept on typing.  I've added the new pages and had trouble right from the start so I went back to the old and got a good start, but going through that added procedure on every new page gets old in a hurry.
    It shows the number of pages at the bottom, but a new page doesn't come on automatically  when I type. 
    Please help.
    Thanks,
    Ron  -  [email protected]

    1. Why not continue to use Pages '09 in your Applications/iWork folder?
    2. In Pages 5:
    Setup (gear icon far right of toolbar) > check Document Body
    and the text will flow from page to page.
    Peter

  • Changing text within frames without adding space at bottom

    Anyone know if there's a method for changing text within frames so that the successive text automatically flows into position without creating blank space at bottom of that current or a subsequent frame?

    Peter,
    You can combine the discussions if you want.  I actually deleted a sentence beginning the second discussion explaining that it was related to the first.  I thought it might impede the discussion.
    Let me describe my problem more completely.  I'm adjusting a book that was carefully crafted using frames for each page so that the text extended to the bottom of each page (frame).  This often splits text within a paragraph between two pages.  This was done so that the customer doesn't feel they are purchasing any blank space and for the aesthetic purpose of filling each page with text.  The only exception is the beginning of new chapters or sections.
    The problem is that I want to change a word here and there in preexisting paragraphs.  When I do, space often one-third the page length is generated at the bottom of a page (frame).  To fill that space and extend text to the bottom of the page again requires -given my current understanding of options- selecting the paragraph (beginning on one page and completed on the second) that has become interrupted by the blank space and performing a "keep lines together" option.  Unfortunately, this usually generates new blank space on a subsequent page, requiring a new "keep lines together"; in a seemingly unending regress of this procedure.
    What I require is a method enabling me to add text within a paragraph that will avoid the generation of the blank space by flowing the subsequent text (composing one or more paragraphs and splitting a paragraph between pages if required) to the end of the page; completely filling the page without requiring any use of "keep options" or whatever.
    Richard

  • Can no longer past formatted text into Mail in iOS 5...

    With iOS 4.x on my iPad, I was able to past in rich, formatted text from other apps.  So I could compose an email with colored text, different fonts/sizes, bulleted lists, etc. in another app and past it into Mail.  It would keep all of it's formatting.
    With the upgrade to iOS 5, this no longer works.  Everything I paste into Mail has no formatting.  I saw this first on my iPad 2 but I just tried on my iPhone 4S and the result was the same.
    Even if I receive colored text in an email, I can't copy it from one place in the email to another and keep the color format.
    Is there some new setting that is disabled that stops me from doing this?  Is anybody else seeing this problem?
    Thank you,
    Roman

    I am using indesign CS2 and i'm trying to import a Word document into a new chapter for a book i'm laying out. it's about 30 pages, but there are at least 80 foot notes. i'm able to get about 1/2 of the document with the footnotes to flow correctly, then EVERYTHING disappears. the only way i've been able to get the remaining text to appear is by adding characters to the text. i'll hit "vvvvvvvvvvvv" a bunch of times and "magically" a little chunk of text and it's footnotes appears. then the ole disappearing act happens. so i do it again. i'm able to get all the text to appear finally, but when i delete the "vvvvvvvvvv" from the places i inserted them, the text disappears again. i have no idea why this is happening or how to fix it. any ideas?
    thanks so much,
    travis

  • Is there a way to include "Formatted Text" content from a form in the e-mail summary?

    I'd like to be able to include some of the content I've created in a form as "formatted text" in the email summary / notification.  Right now, only the fields that require the end user to input data of some type are included in the summary.  Is there a way to do this?
    Thanks,
    -Jeremy

    Hi,
    You can not include custom text in the notification email.  Only in the summary receipt email.  Can you explain what sort of text you want in the notification email?  Also, you may want to post this to the ideas section.  If others vote for it, there's a higher chance of us adding it in a future release.  The ideas forum can be found here - http://forums.adobe.com/community/formscentral?view=idea
    Thanks,
    Todd

  • [CS3 JS] Add formatted text

    I'm working on a kind of templating script. This script adds text to the document depending on some input data, so the text can be almost anything.
    My question is whether there is a convenient way to add formatted text to eg. a given text frame. By formatted I mean a character style applied to it.
    I can think of a solution like inserting the text, then find it and then apply the character style.
    Is there a simplier way, by which I mean a built in function or so?
    Or has someone already written such a function?
    If not then this work is waiting for me, and when ready I'll share the results :)
    Thanks in advance for your help!
    Balázs

    AFAIK,
    You can do as you suggested : place, find and apply style.
    However, you may wonder about the process itself.
    As you create a template, why not thinking about using xml (or tagged text maybe but don't really know nothing about that technique).
    With xml, you can map a style to a tag. Hence, when you place the xml file, it will throw the text with the style applied at the first place.
    What I want to say, is that, as you want to automate things, maybe you can consider richer solutions.
    Loic

  • Is it possible to add new columns with format "Text" once a table is linked to a form

    Is it possible to add new columns with format "Text" once a table is linked to a form in Numbers for iPhone or is it impossible and thus a serious bug?(Rating stars and numeric vales seem to work.)
    Those bugs happen both for new speadsheets as well as existing onces, like the demo. When you are in the form only the numeric keyboard shows up.
    Pat from the Apple Store Rosenstrasse/Germany approved that it looks like a Bug during the Numbers Workshop I was in: It is not possible to add new columns with format "Text". I reported the error for Version 1.4 but there is no update nor do I get statement of understanding the issue.

    Hi Knochenhort,
    I see what you are talking about now. Without knowing how the program actually works, I think this is what's going on:
    When you add a new column to an already existing table (with already existing formats), the new cells come already formatted like the previous column. So when you add a column to the end of the demo table, the cells are already formatted like stars, and when you add a column to the beginning, they're already formatted like number.
    I think this is why it's different when if you add columns to a table with blank (unformatted) columns. In that case, the new cells aren't already "tainted" with a set format, so you can change to text format without issue.
    It seems like the problem is that you can't format cells that are already formatted as "number" as "text" format (even if it doesn't look like they are, because they are blank). IMO, this is a bug! This is why you don't see this issue when adding columns to a new table, because the new cells don't already come with a format.
    To workaround, you can highlight the body cells after adding the new column, and delete the cells. This will "clear" the formatting, so you can then go in the inspector, format them as text, and the correct keyboard will pop up.
    Hope that helps!

  • Import(insert) formatted text(HTML) into document

    Hi guys, I have faceed with folowing problem:
    how to insert into text frame formatted text ?
    At Indesign desktop version this feature was able through pasting HTML from clippboard with appropriate settings of clippboard preferences. But at server version there is no such function.
    I have also invesigated XML import:  you can set up text and paragraph styles and map them with tags but this technique doesnt support nested styles for instance if you have <b><i>xxx</i></b> and appropriate styles "b" and "i" i will be applied to "xxx".
    So I need to insert html as it did clipboard pasting.
    Any thoughts ?

    Questions:
    1. What version of SQL Server are you using?
    2. Are you required to use a specific DTS package or do you simply need to import data from a file to a table?  You might also consider using the bcp utility or, if you are using 2005 or newer, integration services.
    3. Is the uploading of files and the import of data a manual process or is it automated?  Is there a user uploading one file at a time to your server or do you receive files in batches.  Can you describe the work flow?
    You might try the following if you are required to use DTS:
    1. Upload your text file with CFFILE, putting in the directory expected by your DTS package.
    2. Rename the file to the name required by your DTS package
    3. Use CFEXECUTE to run the DTS package by calling dtsrun at the command line.
    dtsrun
    http://msdn.microsoft.com/en-us/library/aa224467%28SQL.80%29.aspx
    bcp
    http://msdn.microsoft.com/en-us/library/aa174646%28SQL.80%29.aspx

  • Inserting formatted text

    How can I insert formatted text into the sequence, keeping it transparent so I can show it over another clip? The text generator doesn't let me vary the text within one frame. So if I have, "The Doodad Theatre Production of, Don Juan" and want to make Don Juan bigger, I can't. Also, Title 3D does not show up in my popup window and I can't find a way to access it.
    Thanks for your help!
    Elise
    Mac G5   Mac OS X (10.4.4)   FCP HD5

    Two ways to get it done;
    #1. Reinstall the Boris Calligraphy plugins from your FCP install disc. Title 3D is part of that plugin bundle.
    #2 Create the text in Photoshop as a TIF or PSD with a transparent backround, then import the PS file into FCP.
    -DH

  • Cannot paste formatted text.

    I am using ID CS 3 on a Macbook Pro, running OS 10.6.2.
    My problem is that I have text formatted italic and bold from Text Edit but I cannot paste the formatted text (or import it) into ID without losing all formatting. I went to this Discussion Forum and looked there first and the only fix I am finding is to make sure that preferences allow me to paste formatted text. In my ID preferences it is selected that when pasting text from the clipboard that all styles will be retained but this is not what happens. I can copy and paste the formatted text in TextEdit and can also create formatted text within ID and copy and paste that as well. But I cannot do this between the two programs.
    Any suggestions?

    What I am trying to place is an rtf text.
    What I have done since posting this issue:
    1. Restarted ID several time, restarted computer.
    2. Logged in on another account, bypassing all logon items.
    3. Disabled all added plugins, leaving just the Adobe and required plugins.
    4. Started with a fresh ID document.
    None of this has solved the problem, I simply CANNOT paste in formatted text.
    Other suggestions?

  • JTextPane - HTML Formatted text Overlap!!!!!!!!!!

    The formatted text overlaps in the printed sheet, but
    it is displayed correctly in the JTextPane
    Code is below:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.print.*;
    class Test implements Printable {
    static JTextPane pane;
    static public void main(String args[]){
    pane = new JTextPane();
    pane.setContentType("text/html");
    pane.setText("<html>"
    +"<font face=Serif size=-1>plain<b>bold</b>plain</font><br>"
    +"<font size=+0>plain<b>bold</b>plain</font><br>"
    +"<font size=+1>plain<b>bold</b>plain</font><br>"
    +"<font size=-1>...................................plain<b>bold</b>plain</font><br>"
    +"<font size=+0>...................................plain<b>bold</b>plain</font><br>"
    +"<font size=+1>...................................plain<b>bold</b>plain</font><br>"
    +"<font size=-1>.......................................................................plain<b>bold</b>plain</font><br>"
    +"<font size=+0>.......................................................................plain<b>bold</b>plain</font><br>"
    +"<font size=+1>.......................................................................plain<b>bold</b>plain</font><br>"
    +"<font size=-1>@@@@@@@@@@plain<b>bold</b>plain</font><br>"
    +"<font size=+0>@@@@@@@@@@plain<b>bold</b>plain</font><br>"
    +"<font size=+1>@@@@@@@@@@plain<b>bold</b>plain</font><br>"
    +"<font size=-1>@@@@@@@@@@@@@@@@@@@@@@plain<b>bold</b>plain</font><br>"
    +"<font size=+0>@@@@@@@@@@@@@@@@@@@@@@plain<b>bold</b>plain</font><br>"
    +"<font size=+1>@@@@@@@@@@@@@@@@@@@@@@plain<b>bold</b>plain</font><br>"
    +"<font size=-1>plain<i>italic</i>plain</font><br>"
    +"<font size=+0>plain<i>italic</i>plain</font><br>"
    +"<font size=+1>plain<i>italic</i>plain</font><br>"
    +"<font size=-1>...................................plain<i>italic</i>plain</font><br>"
    +"<font size=+0>...................................plain<i>italic</i>plain</font><br>"
    +"<font size=+1>...................................plain<i>italic</i>plain</font><br>"
    +"<font size=-1>.......................................................................plain<i>italic</i>plain</font><br>"
    +"<font size=+0>.......................................................................plain<i>italic</i>plain</font><br>"
    +"<font size=+1>.......................................................................plain<i>italic</i>plain</font><br>"
    +"<font size=-1>@@@@@@@@@@plain<i>italic</i>plain</font><br>"
    +"<font size=+0>@@@@@@@@@@plain<i>italic</i>plain</font><br>"
    +"<font size=+1>@@@@@@@@@@plain<i>italic</i>plain</font><br>"
    +"<font size=-1>@@@@@@@@@@@@@@@@@@@@@@plain<i>italic</i>plain</font><br>"
    +"<font size=+0>@@@@@@@@@@@@@@@@@@@@@@plain<i>italic</i>plain</font><br>"
    +"<font size=+1>@@@@@@@@@@@@@@@@@@@@@@plain<i>italic</i>plain</font><br>"
    +"</html>");
    JFrame frame = new JFrame("Printing test");
    frame.getContentPane().add(pane);
    frame.setSize(600,800);
    frame.setVisible(true);
    PrinterJob job = PrinterJob.getPrinterJob();
    job.setPrintable(new Test(), job.defaultPage());
    if (job.printDialog()) {
    try { job.print(); }
    catch (Exception e) { }
    System.exit(0);
    public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException {
    if (pageIndex >= 1) return Printable.NO_SUCH_PAGE;
    Graphics2D g2d = (Graphics2D)g;
    g2d.translate((int)pf.getImageableX(), (int)pf.getImageableY());
    g2d.setClip(0, 0, (int)pf.getImageableWidth(), (int)pf.getImageableHeight());
    try { pane.print(g2d); }
    catch (Exception e) { }
    return Printable.PAGE_EXISTS;
    The bold text overlaps

    I think the textpane wisth has is not adustable to theformatted text to acccomodate

  • Capturing formatted text

    I am some code that cuts up the text in a text box and puts it in mulitple text boxes. The problem is that it gets formatted text but I need to capture the formatted text. My code that gets the text is below:
    set myText to contents of selection of myDocument
    But this only captures the plain text. How should I change my approach?

    @Paul – I'm not too much into AppleScript, but you are using the "contents" (unformatted text) property of an object.
    How would it work if you are using the text directly?
    Dummycode here (don't know if it will work at all):
    set myText to text of selection of myDocument
    in JavaScript (ExtendScript) that would be:
    var myText = app.selection[0].texts[0];
    What exactly is selected? A text frame? Or is it the text itself?
    Uwe

  • Just tried adding some text to a video (MP4) how best to optimise?

    Hi,
    Any suggestions on this?
    I imported a short MP4 into CS6, then added some text diplaying on part of the timeline so the text fades in, displays, then fades out, all well and good.
    I then re-saved it as a new MP4 I'd like to know if it is possible to optimise the file at all. (never tried any of this stuff before)
    Before anyone suggests anything fancy, I ONLY have access to Photoshop CS6. So If I need other software then that is no help.
    Any suggestions.
    Thanks, McP

    Sorry, should have been clearer.
    Optimise the file size in bytes, obviously it is possible to create PSDs and other format images etc then save for web.. Does the same apply to MP4s when using PS6?
    Can the size of an MP4 file be reduced in any way, subsequent to me adding extra time lines that have text in them?
    And by fancy, I meant After effects and other Adobe suite progs, as mentioned I only have PS6. Never tried getting to know MP4 manipulation in PS before, so not aware of free things either..
    McP

Maybe you are looking for