开发者

Generating documents in multiple applications

开发者 https://www.devze.com 2022-12-09 05:04 出处:网络
I need to create an application that generates a bunch of templates for Office (2000), OpenOffice.org (2.0) and InDesign. The design of the templates will be made in each application but we need a sys

I need to create an application that generates a bunch of templates for Office (2000), OpenOffice.org (2.0) and InDesign. The design of the templates will be made in each application but we need a system for placeholders so that my application opens a template, replaces the p开发者_StackOverflow社区laceholder with some text (like a name, address, phone number) and saves the document.

What is the best way to work with these placeholders? My idea would be to define a placeholder using square brackets like [address], [phone] and then do a search and replace with content I retrieve from a database. Indesign allows to create named textboxes so I just have to insert text in the right textbox.

Does anyone have a better idea?


A lot of folks will create tokens (placeholders) using the $$xxxxxx$$ format where $$ both start and terminate the token. But for programs that have a built-in ability to provide something like this (e.g. named textboxes in InDesign, content controls in Word 2007, etc.) it is generally better to use those as they many times have extra functionality, like retaining formatting when the text changes or is inserted.

0

精彩评论

暂无评论...
验证码 换一张
取 消