14 Replies Latest reply on Oct 8, 2014 7:44 PM by MW Design

    Is there a way to import html text from a website and have it format with styles in CS6?

    VinDog

      Example: @category:Events @header:Annual Get Together @body:#11824: The Parks office will hold their annual party

       

      Would come into ID with the Category, Header, and Body styles formatted and ready to go to print. We could do this in Quark, but I'm not sure how to set this up or if it's possible in ID. Any help is appreciated.

        • 2. Re: Is there a way to import html text from a website and have it format with styles in CS6?
          MW Design Level 4

          How about posting how the HTML really looks?

           

          That looks like Q's Xtags. So whatever is generating the output to achieve the Xtags, have it output XML (one solution) or have it coded to output ID tagged text (second solution). Yet another solution would be to bring in the Xtag'd file as text and use Grep, javascript to format the document (never done it, but should work).

           

          Even with actual HTML, it doesn't take much to add the requisite code to change it to XML for the purposes of flowing it in with styling.

           

          Mike

          • 3. Re: Is there a way to import html text from a website and have it format with styles in CS6?
            VinDog Level 1

            Thanks for the clarification Mike.

             

            These are events from our website that we use in our printed product. I'm sorry that I don't really know the terminology of what's going on here but we have had some staffing cutbacks and am just trying to figure a solution out.

             

            An example:

            @category:Bulletin Board

            @header:Household hazardous waste drop-off events

            @body:#11595: Hennepin County and its partner cities will hold community collection events this spring for residents to safely dispose of unwanted garden and household hazardous waste. Only household waste will be accepted. For a complete list of acceptable and non-acceptable items or more information on drop-off facilities, call 612-348-3777 or visit <B>www.hennepin.us/collectionevents<P>. Note: This year, the county will not be accepting electronics at the collection events; business waste also will not be accepted. A collection event will be held in North Minneapolis <B>Thursday-Saturday, July 31-Aug 2, 9 a.m.-4 p.m.<P>, at Jenny Lind Elementary, 5026 Dupont Ave. N; and in Northeast Minneapolis <B>Thursday-Saturday, Aug 21-23, 9 a.m.-4 p.m.<P>, at 340 27th Ave. NE.

             

            So if I'm reading what you're saying above correctly, the @category and such are Xtags and I should be able to talk with our website administrator and have them switch to output as XML or ID tagged text and then bring that into ID?

            • 4. Re: Is there a way to import html text from a website and have it format with styles in CS6?
              MW Design Level 4
              So if I'm reading what you're saying above correctly, the @category and such are Xtags and I should be able to talk with our website administrator and have them switch to output as XML or ID tagged text and then bring that into ID?

               

              I believe they are outputting your html--or rather, what is being output as HTML for the web site (a database, likely SQL)--for the Xpress tags. Here's a snippet of the actual HTML from one of the bulletin pages:


              <div class='bulletin_display' id='bulletin_content'>

              <h2 class='bulletin_subject'>Household hazardous waste drop-off events throughout Hennepin County</h2>

              <span class='dateline rs_skip'>Hennepin County sent this bulletin at 05/29/2014 03:41 PM CDT</span>

               

              That is HTML. The data for which likely reside in a database and for the @ symbol to appear, likely the database is being output in Xpress tags via a query or post export or however. So yep, talk with the people who would know how the data is being taken from the database and formatted. And give them an example of what you need.

               

              Copy some of an actual page's content (using your web browser), paste it into a text editor, copy that again and paste it into ID. Format it in ID how you would like it. Export it out as tagged text. Give that to them and request the output to be formatted as per the sample. Alternatively, you should be able to have them output actual XML.

               

              Take care, Mike

              • 5. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                VinDog Level 1

                Hi Mike,

                 

                So our website guy has set up the tagged text for output, but I cannot get Indesign to place the plain text file (I have tried both Word plain text and Text edit plain text files) and style the text. It will import but the ID tags are showing. Is there something our guy may be doing with the code that ID is not responding to. The tags and styles have the exact same names. Any help is appreciated.

                 

                An example of actual text output from the website:

                <ASCII-MAC><Version:8><FeatureSet:InDesign-Roman><ColorTable:=<Black:COLOR:CMYK:Process:0, 0,0,1>><DefineParaStyle:Category=<cSize:22.000000><cHorizontalScale:0.960000><cLigatures:0 ><cTracking:-15><cBaselineShift:-0.000000><cKerning:0><cLeading:26.000000><cFont:Longhand> <cColorTint:100.000000><pTextAlignment:Center>><DefineParaStyle:Header=<cTypeface:Bold><cS ize:10.000000><cLigatures:0><cBaselineShift:-0.000000><cKerning:0><cLeading:11.000000><pSp aceBefore:9.000000><cFont:Myriad><cColorTint:100.000000>><DefineParaStyle:Body=<cTypeface: Roman><cSize:8.000000><cLigatures:0><cTracking:-15><cBaselineShift:-0.000000><cKerning:0>< pFirstLineIndent:9.000000><cLeading:9.000000><cFont:Myriad><cColorTint:100.000000><pTextAl ignment:JustifyLeft>>

                <ParaStyle:Category>Bulletin Board

                <ParaStyle:Header>Weekly MNSure help at ESNS

                <ParaStyle:Body>#11877: <cTypeface:Bold>Every Monday<cTypeface:> a MNSure Navigator is at <cTypeface:Bold>East Side Neighborhood Services<cTypeface:>, 1700 Second St. NE, 11 a.m.-1 p.m., by appointment, to offer in-person assistance signing up for health coverage through MNSure, a central marketplace where Minnesotans can get health insurance. For more information or to make an appointment, call Laura at 612-781-6011.

                Every Monday

                East Side Neighborhood Services, 1700 2nd St. NE, Minneapolis. 612-781-6011, www.esns.org.

                For more information contact Laura, 612-781-6011.

                 

                 

                <ParaStyle:Header>Flu Shot Clinic for artists and their families

                <ParaStyle:Body>#11830: Springboard for the Arts will have a Flu Shot Clinic <cTypeface:Bold>Thursday, Oct. 16, 6-7:30 p.m.<cTypeface:> at <cTypeface:Bold>Open Book<cTypeface:>, 1011 Washington Ave. S., Room 203. Uninsured and underinsured artists, arts administrators and their families can get vaccinated. Flu shots are available for adults and children ages 3 and older and are free with pre-registration. The clinic is presented in partnership with Minnesota Visiting Nurse Agency and Open Book. While at Open Book, participants are encouraged to visit the Minnesota Center for Book Arts / Jerome Foundation Book Arts Fellowships Series exhibition, or attend Ten Thousand Things’ performance of Romeo and Juliet at 8 p.m. For tickets and information, visit <cTypeface:Bold>www.tenthousandthings.org<cTypeface:>. To register for a flu shot, visit <cTypeface:Bold>http://springboardforthearts.org/product/october-16-flu-shot-clinic/<cTypeface:>.

                Thursday, Oct. 16, 6-7:30 p.m.

                .

                 

                 

                <ParaStyle:Category>Events

                <ParaStyle:Header>Northeast Celebration: An Evening of Business and Community Awards

                <ParaStyle:Body>#11845: The Northeast Minneapolis Chamber of Commerce and the East Side Exchange Club are hosting "A Northeast Celebration: An Evening of Business and Community Awards," to honor those that serve and support our community, <cTypeface:Bold>Thursday, Oct. 30, 5-7 p.m.<cTypeface:>, at <cTypeface:Bold>Jax Cafe<cTypeface:>, 1928 University Ave. NE. The event is open to members and non-members at a cost of $40 per ticket. Pre-registration is required. For more information visit <cTypeface:Bold>www.minneapolischamber.org<cTypeface:> or contact Christine Levens at 612-378-0050 or Email link: <cTypeface:Bold>clevens@minneapolischamber.org<cTypeface:>.

                Thursday, Oct. 30, 5-7 p.m.

                Jax Cafe, 1928 University Ave. NE, Minneapolis. 612-789-7297, www.jaxcafe.com.

                For more information contact Christine Levens, 612-378-0050, clevens@minneapolischamber.org.

                • 6. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                  MW Design Level 4

                  Try the ZIP file:

                  https://www.dropbox.com/s/hs54tknb1cup77n/VinDog.zip?dl=0

                   

                  Obviously didn't recreate your styles. But what I did do was to strip the tags from your sample above. Created paragraph and character styles. Applied those styles to the text. then I exported the tagged text. It imports fine.

                   

                  So, create the formatted text as you desire, being sure to include all the styles (both paragraph and character styles), export it to tagged text. Forward that onto the web site guy so he can wrap the text in exactly those styles and inject the exact header information that ID is going to need.

                   

                  Doing it this way is the only means I know of to get the correct output so placing those tagged text files works as expected.

                   

                  Take care, Mike

                  • 7. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                    VinDog Level 1

                    I'm confused now. I formatted the text and exported the tagged text to begin with so that the website person could create what I have above. I'm confused as to why doing that again would help unless what is being output above for text is not correct for tagged text. I will also let the website person see what you did and maybe they can figure it out. I'm out of my element on this.

                    • 8. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                      MW Design Level 4

                      Well, don't be confused...I didn't know you did the export.

                       

                      Without the document this is to be imported into, I cannot really see/say what is going on. In general, it would be good to compare what you gave the person to what actually gets imported. Likely there is something about their export that is not matching up properly to the sample you gave them.

                       

                      If you would like me to look at it, and if you are using any of the CC versions, please save a copy as IDML for version CS6. I think my trial for CC2014 might have expired today...but I am running so much software at the moment I don't want to start it to find out. It would be good to ZIP up the IDML or the INDD file along with the tagged text export you did, and the actual export from the web export.

                       

                      Mike

                      • 9. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                        VinDog Level 1

                        We are using CS6 Mike. Here are the zipped files. You’re very kind to take the time to help out on this. I really appreciate your expertise.

                         

                         

                        Vince Brown

                        Customer Service

                        Northeaster and NorthNews Newspapers

                        2844 Johnson St. NE

                        Minneapolis, MN 55418

                        612-788-9003 (main office)

                        612-788-9004 (classified ad line)

                        612-788-3299 (fax)

                        contact@nenorthnews.com

                        • 10. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                          MW Design Level 4

                          Hello Vince...I cannot see the link for the file(s).

                           

                          BTW, if you need these private now or in the future, you can opt to click on my name and send an email with a download link. I forgot to mention that earlier.

                           

                          Take care, Mike

                          • 12. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                            MW Design Level 4

                            Vince,

                             

                            Open the file as given to you from the web person. Go to the closing angle bracket for the encoding string. Press enter so the encoding string is the only thing on line 1 of the file. Disregard the line ending symbol. I have my editor show various line ending symbols based upon the encoding. Anyway, make it look like the picture...

                             

                            capture-002131.png

                             

                            Then try loading it into your template. Have the output as per the above and I think you're all set.

                             

                            Take care, Mike

                            • 13. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                              VinDog Level 1

                              Awesome! That works like a charm! Thank you so much Mike!

                              • 14. Re: Is there a way to import html text from a website and have it format with styles in CS6?
                                MW Design Level 4

                                Good to hear, Vince.

                                 

                                Sometimes the simplest things elude me. I should have caught it when you posted the code above.

                                 

                                Take care, Mike