is now part of CreativePro.com!

Pasting Formatted Text Into InDesign

47

MD wrote:

I’ve just been hired to turn my online newspaper into print so I’m learning InDesign, but when I cut and paste anything into InDesign from NVU or Outlook Express, I lose all formatting and end up having to reformat everything. Any way around this?

By default, InDesign strips out all the formatting from incoming text when you copy and paste it from any other application. By contrast, if you copy and paste from one InDesign document into another, it maintains the formatting… unless you use Edit > Paste without Formatting. That’s a great feature when you need to strip away unwanted styles.

Fortunately, there’s also a way to maintain formatting when you paste it from some other applications. Open the Preferences dialog box (Command/Ctrl+K) and look for the When Pasting Text option in the Clipboard Handling area. Change this from Text Only to All Information.

However, note that I said “some” applications. It doesn’t work with all applications. For example, it doesn’t seem to capture text formatting from Firefox on the Mac, but it works fine when copying from Safari.

And, of course, it’s only going to copy local “hard” formatting from other applications; you’d be best off replacing that formatting with paragraph and character styles once the text is inside InDesign.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • Marcel says:

    Hi MD,

    I was thinking, it is an online-newletter you are publishing.
    Maybe you can export the data/text to html or XML and try to import this into Indesign.
    I guess you using css-styles in your newsletter and may this comes handy importing the newsletter into Indesign. Let Indesign link the css-style to an paragraph-style.
    It was just a thought.. maybe it saves you allot of time..

  • Eugene says:

    One interesting thing about the way that David describes the technique for copying from the web is that the Paragraph styles are Character styles are maintained, I think. Italics are “emphsis”, bold is “strong” and headings are “H1”, “H2” etc. I could be totally wrong here, it could be just for websites that have CSS or similar, which I’m not totally clear as how all this works, it’s just an observation.

  • Jeff Potter says:

    If you are using any sort of content management system that saves to a SQL database, it’s possible to create a PHP script that can capture the formatting and write the whole thing to an XML file. You can then import it and use the Map Styles to Tags feature to import text that not only preserves styles but arrives into InDesign preformatted.

  • Klaus Nordby says:

    I just tried this now (Windows) with copying formatted web page text from Dreamweaver CS3 into IDCS3 — it doesn’t work, it comes in as plain text. And Placing HTML gives me *all* the source code, so that’s not doable either. Pasting from Opera also gives plain text.

  • Eugene says:

    You know what. I just printed this page to PDF and the saved it from Acrobat to RTF and then Placed it into InDesign. Kept all the text formats. Granted it was the CM+10 nonsense style names, but all the information was there.

  • Bob Stucky says:

    Importing html into InDesign is problematic at best. If you try to import via XML, you have to set up styles for every html tag, and then still write a script to handle some stuff (especially images). CSS is pretty much out of the question.

    The firm I work for does cross-media database publishing software (web->print->cd). I wrote their latest Print module. It has the ability to import HTML including CSS into InDesign and have it come out pretty much (99%) correct. It handles colors, styles, tables, lists, images (including image mapping from low-res web to high-res print images).

    You can import an html page from the local file system or via a url (it goes and gets the html).

    You can also create an xml file that contains data from a database. The format is straightforward enough (of course, our product does that for you). The XML contains data attributes from the database (which can be html pages, html snippets, or plain text), and then executes an import using a template that is html with a couple of enhancements.

    It’ll do what you need; however, we’re not quite to the point of releasing it as a separate product.

    If enough folks are interested, let me know ([email protected]) and we could make that happen.

    Regards

  • Anthony Reimer says:

    Bob Stucky has it right. Getting HTML or other marked up text into InDesign is difficult when it is possible at all. Ideally, I want someone to create a plug-in (or an entire page layout program) that can deal with XHTML and CSS. Even just parsing paragraph and character markup from an (X)HTML document in a meaningful way (i.e. not the convert-to-absolute-markup method that David’s tip uses) would be useful. Since I don’t have the resources that Bob’s firm appears to have, I do those particular jobs the only reasonable way I can: I use QuarkXPress. It’s shameful that Adobe has done nothing on this front in five versions of ID.

  • Caspian says:

    I am confused.
    OK, so you can copy and paste *without* formatting the text, but can you copy text (without copying the para style) from one InDesign doc to another. This would save me time reformatting the new text boxes that has a new style attached to it.

  • Caspian, that’s what the Edit > Paste Without Formatting feature is for.

    (I only recently realized that Word has a similar feature. I was so tired of copying text from InDesign and pasting into Word and then having to strip out the formatting. Then I noticed the Paste Special feature in Word, which lets you paste unformatted text. I assigned a keyboard shortcut to it, so it’s easier to use.)

  • Leslie Nicole says:

    Do I understand this correctly that paste without format will NOT import with styles? Because I’m not finding that to be the case.

    I have a situation where I have to pick up a lot of text from older catalogs. In my experiments. I usually break the link to style because I often have big problems where similarly named styles are different.

  • Leslie, if you copy text from one InDesign document and use Edit > Paste Without Formatting in another document, InDesign should totally ignore the formatting (including paragraph and character styles).

  • Leslie Nicole says:

    OK, I see how I’m misunderstanding the intent of this. Yes, it will paste the text without reformatting it to the local styles. It does bring in all it’s own styles, however. For my needs, Breaking the style works better for what I want to do. More work, but we have to constantly pick up and paste text from other books and it gets to be a nightmare of style sheets after awhile. Thanks for expanding my understanding of this.

  • Leslie, I think there’s a bug here. If you paste without formatting when the text cursor is flashing in a frame, then the paragraph styles from the other document are not imported. But if you paste without formatting with nothing selected on the page, then you get a new frame and the styles are imported. That shouldn’t happen, I think.

  • Leslie Nicole says:

    David,
    I just tried this. It still brings in the other styles. It DID take on the paragraph style I had selected for the text box (body) but also brought in the body style from the origin document and renamed it “body copy”. It also brought in all the other paragraph and character styles that had been in that paragraph from the origin document.

  • Not sure what the problem is then, Leslie. Are you using CS2? In my CS3 documents, the paste without formatting works flawlessly, but only when the text cursor is inside a text frame.

  • Leslie Nicole says:

    Yes. We’re still in CS2 at work. I’ll try this at home with CS3 and see if there is any difference. Thanks.

  • Sade says:

    i have a linesheet that i’ve created on indesign CS3. im trying to get it to ‘print to web.’ i’ve managed to save it as both and html and a xml. both times whoever it will not transfer or change my photos, into the feature. and i cant see it frm the web, which means buyers cant either.

    im not sure what im doing wrong.

  • Sade, InDesign really isn’t a good method for laying out a Web page. However, you’ll find more information about what you want to do on this other post.

  • Bryan Cottrell says:

    David,
    I’m running into the same issue as Leslie is with the paste without formatting. I’m using CS2 and it’s frustrating that it brings in all the styles even when I do it like you suggested.

  • I publish a newspaper and program in Perl. What I’ve learned and it works VERY WELL is that you can design your webpage based on tables. It will import into InDesign, but you have to use MS Word to make it work. First, when building your html table, wrap the words using the font tag and set the font-face, font-size, color, border, margin, padding, line-height etc in the style attribute. To make the word bold, wrap the font tag in a bold tag and the same for italics, strike-through, underline, etc (basic HTML tags). For carriage returns, don’t use br, use an open and close paragraph html tag back to back. Once all of your document is built, view your page in a web browser. Select-All of the page, copy & paste (the working copy … if in Frontpage, render in Preview mode) into Microsoft Word. Save it as a Word Doc (it will look odd, but MS Word does some kind of conversion which makes it work in InDesign). Go into InDesign, create a text box and import (File > Place) the MS Word Doc into it. You will see your html table intact and it will have all correct attributes in-tact. You can double click in the cells and resize the table, shade the cells to your liking. The only drawbacks I found is that InDesign has a maximum table height limit. At one time, I found a key-combination to unlock the max-height, but never found it again (doh!). So, if you have a lot of text, you will have to create another row below and copy the remaining overflow text into it. Also, Images in a table don’t allow word wrapping to be set, which is a pain! I’ve been using this technique for around 3 years since CS1 and it works like a charm. The rule is you have to and can use all basic HTML 3.2 tags with style attributes in the style attribute in the HTML tags. I’ve written entire programs to utilize these techniques! MS Word bridges the translation. I haven’t tried this with Open Office, but who knows, it may be an alternative to expensive MS Word. Anyway, this solution took me many months to figure out with very little help on the Internet and I hope it can help others! Oh, for image tags, use real world https:// source locations. When you copy into MS Word, the images will follow … even into InDesign. I believe MS Word embeds the image into the file. It’s great!

  • Here’s a follow-up HTML example to what I discussed previously. I hope it prints right:

    <table style=”width: 3in; border: .05in solid #000000; padding: .1in;”>
    <tr>
    <td style=”font-family: Arial;font-size: 10pt;line-height: 10pt;”><font style=”font-family: Arial;font-size: 10pt;line-height: 10pt;>This is a test of the <b>HTML Table</b>.</font><p></p><font style=”font-family: Arial;font-size: 15pt;line-height: 15pt;>This is another test of the <b>HTML Table</b> concept.</font></td>
    </tr>
    </table>

    Notes: In the <td> tag, specify a default font-family, font-size for the entire cell. I’ve found this to be very important if you’re using multiple font sizes in the cell. Also, the <p></p> is to be used instead of the <br> tag. This tells InDesign that the next set of words is to revert back to the default cell font-size and listen to the next font-size in the style attribute. But the new paragraph tag WILL result in a carriage return, so it’s not perfect. This is designed so you can specify different lines with different font sizes throughout the cell, but on different lines. If you don’t use the paragraph tags, the whole cell will use a line-height set to that of the maximum font’s line-height in the cell. If you have a 15pt font with 15pt line-height and also a 9pt font, if you don’t use the paragraph tag, the 9pt font will have a line-height set to 15pt, which will look horrible. So, each font-size different from the previous will need to be on a separate line.
    For the entire table, you can specify the table dimensions in the style attribute along with border, etc. Once you play with it, you’ll get the hang of what you can and can’t do! Just wish word wrapping would work with images in tables. The align attribute works, but words won’t wrap. Also, from what I remember, you can’t put tables in tables. I tried this to put an image in a table to float it to the left and right of a document to fake a word-wrap, but it never worked. InDesign still has it’s limits.

  • aawargi says:

    hello
    i just try this tip in mac for indesign CS2.
    when i copy text from MS word it work perfectly.
    but when i copy the formatted text from Illustrator CS2 and paste it in indesign all the formating is gone …!
    why is that …
    and how can I can get the text formatting from illustrator to indesign CS2 …?

  • aawargi: Unfortunately, that is pretty difficult. See this post for more information.

  • The Intern says:

    I’m having trouble with pasting in tables without formatting. I got it to work once, but since, it has either pasted with formatting (cells within cells) or the option has not been available. Help?

  • Intern: If you have the text cursor flashing inside the cell when you paste, you’ll get a table within the cell. If you select the cell itself (press Esc to select the cell), it’ll paste “unformatted” into the cells to the right and down.

  • Greg Mouning says:

    I’m stumped. The “Paste without Formatting” is not accessible (greyed out) when I try to copy text from Microsoft Word and paste into Indesign CS3 on the Mac. I can only Paste which brings in the formatting from Microsoft Word. Can you tell me how to override or correct this behavior?

    Thanks,
    Greg

  • Bob Levine says:

    @Greg: Check your clipboard handling preference. You want to change your preference when pasting from other applications to text only.

  • Steven Logan says:

    When ever I copy text boxes out of one Indesin file and paste it into another, it changes some of the formating , ie spacing and syles. Anyone else come across this?

  • Alex says:

    In CS3 the maximum row height is determined by the Maximum setting in the Rows and Columns section of the Cell Options dialog box.

  • eagleapex says:

    Great help. Thanks!

  • Frank says:

    When I paste is a Word document into InDesign CS2 the every line in the paragraphs come in as hard returns so the copy doesn’t flow correctly. I have to bring up every line to rejoin its own sentence. There is no formating in the copy just a straight paragraph. How can I fix this?
    Thanks

  • […] If you need to import HTML, it’s usually best to use some intermediary to convert it. For example, you can save the HTML to disk, open it in MS Word, export it as docx or RTF, and then place that in InDesign. It’s not a fun or quick process, but you can sometimes get it to work. Ultimately, many people give up and just use the old copy-and-paste. […]

  • Javier says:

    Almost 4 years later, and this tip is still very useful! Cheers!

  • vish says:

    Understanding of InDesign, I know that it uses icml formatting for all the content. So if you can save the html format with all styles and attributes as a string in your database and generate a XSLT file and use a build script to convert XSLTL to ICML. There is a lot of information on adobe forums with regards to this topic.

    Adobe Forum

    Tools to convert XHTML to IDML/ICML Forum

    I hope this is helpful for all publishing enthusiasts out there!

  • Sooo helpful :)

    Thank you :D

  • Adri de Bruyne says:

    Hi there,

    I’m trying to set this in CS6 – any hints?
    I can’t find the “When Pasting” option anywhere… Will keep looking.

  • Jaci says:

    This is great, just what I was looking for. Formatting a directory is super repetitive, this will save so much time.

  • Marian says:

    Is this method still valid?
    Thanks, Marian

  • Sam McNeish says:

    I have read the preamble which lead me to this page and all teh comments and each of those tidbits will help me in my transition from Quark to InDesign. As one of my activities, I style agate for sports pages. The information is gathered from various providers and accumulated in a word document that we style with bolds and some formatting prior to dropping on the newspage I prepare daily. This works exceptionally well and is similar to the quark process which I previously used. One strange thing we have discovered is that for some reason, extra spaces are being added between each line of the agate and I am note sure if there is a fix for this issue in InDesign? As it stands now, I have to go through each line separately. hit delete at the front so it goes back up to the previous line and then hit a soft return to eliminate the spaces. Is this common or an anomoly? Anyone who has a solution I would love to hear from you!!
    Many Thanks!!!

    Sam

    • crych says:

      Sam, it sounds to me as if you do not have extra spaces, that is, extra paragraph returns, between the lines, but that the style applied to the agate lines upon import has space before or after or both in its definition. If this be the case, you need only change the space before and space after in Paragraph Style Options > Indents and Spacing to zero.

  • Glenn Cheney says:

    In CS6, when I set preferences–cliboard handling to “text,” and paste into indesign, I get paragraph breaks correct but no italics. When I set pref to All Information, I get italics but no paragraph breaks. How can that be? How can i get both breaks and italics????

  • It’s not my first time to pay a quick visit this web page, i am visiting this web page
    dailly and get nice information from here everyday.

  • Aaron Linsdau says:

    I created a video showing how to import formatted text from all web browsers into Indesign. There’s a unique special connecting step that keeps the italics, bold, and underline text intact from Chrome, Safari, Firefox, and Internet Explorer when imported into Indesign:
    https://youtu.be/_Dq5h5MMfDo

    Also, here’s the video of how to fix the formatted text import problem from Word into Indesign:
    https://youtu.be/W63Yw5WuGIw

  • >