Link This |
Email this |
Blog This |
Comments (2)
CSS to InDesign styles might be easy
August 28, 2008
I’ve been studying Cascading Style Sheets (CSS), the latest (several years old) technology for making nice web sites. CSS allows for a nicer appearance on many web sites, and also releases web site designers from the tyranny of basic HTML (HyperText Mark-up Language) which is too primitive for most authors.
The best feature of CSS is that the styling and the content are separate, which allows the same information to be presented in different ways by (I won’t say “simply”) changing the style sheet. And, a single style sheet can have any number of web pages draw from its styles to format and present the information on a web site. (For many great examples of this, please visit
CSSZenGarden.com.)
For example, a style sheet might contain a simple style like this:
P {
font: "Trebuchet MS";
font-size: 13px;
line-height: 1.5em;
color: blue;
text-align: left;
}
which is called by the complementary HTML page as simple <p> put in front of any paragraph of text.
<p>The gardener comes on Tuesdays, but you can relax every day at the Homestead Resort</p>
When that
<p> goes into effect, the paragraph will be styled with 13 pixel tall Trebuchet type in blue, aligned left with leading (line-height) set to 1.5 times the point size. At the end of the paragraph, a paragraph cancel code must be entered
</p> which causes the type to revert to “default” (which can vary depending on the viewer’s browser preferences).
I’m not trying to teach you CSS. Not here. Not now. Not ever. Oops, I have been watching the Democratic National Convention; I let that slip.
What I have been considering is how CSS might be translated into InDesign tags, which would result in fully-formatted text for the printed page with just a little bit of intervention.
InDesign styles, when embedded as tags in plain text are surprisingly similar. They look like this:
<pstyle:Paragraph>The gardener comes on Tuesdays, but you can relax every day at the Homestead Resort
And, unlike HTML coding, InDesign has a policy that a style stays in effect
until further notice, so you do not need to cancel each style.
There is a small amount of one-time encoding to define the appearance of the style, which typically looks like this:
<ASCII-MAC><vsn:5><fset:InDesign-Roman><ctable:=<Black:COLOR:CMYK:Process:0,0,0,1>>
<dps:Paragraph=<Nextstyle:Paragraph><cs:11.000000><cl:15.200000><ph:0><psa:9.000000><cf:Trebuchet MS><pswa:Left>>
In recent blogs on other parts of GAM Online there has been a fair amount of discussion of PURLs – Personal Universal Resource Locators – web pages which have been created for an individual viewer. It’s variable-data printing extended to the web, and with some of the more sophisticated marketers, it’s the way to close the loop with a printed marketing piece and a marketing web page that will drive a customer to click on the
BUY NOW button.
Converting CSS to InDesign would be only moderately difficult. I could write a program in AppleScript in an evening or two that would do it. In fact, I probably
have an AppleScript program in my archives that will do it already with some small coding changes.
About ten years ago I wrote an AppleScript program that took QuarkXPress tagged text and converted it to HTML for a classified ad newspaper. The project ended in failure because the company that owned the chain of newspapers wouldn’t allow one franchise to have “maverick” software. And, since the parent corporation hadn’t written the software, it was unacceptable. They shut down the operation in its second week. That was too bad, because I could have made a lot of money with the program.
But now it’s back! Now I can resurrect my AppleScript program and apply it to CSS work (in the opposite direction). With that, I think I can convert text that has been encoded for web delivery to handsomely-crafted InDesign documents. All it will take is a few sleepless nights, and I’ll be making print documents from CSS pages, and who knows, maybe there is someone out there who might want to do this.
Posted by Brian Lawler on August 28, 2008 | Comments (2)