Download presentation
Presentation is loading. Please wait.
Published byLoreen Elliott Modified over 9 years ago
1
Serving Word September 18, 2002Samuel R. Neff Serving Word Using HTML, XML, and CSS to Dynamically Generate Word Documents Samuel R. Neff B-Line Express
2
Serving Word September 18, 2002Samuel R. Neff Agenda Automation Document Properties HTML, XML, CSS –Formatting –Labels –Columns –Headers, Footers –Images Alternatives
3
Serving Word September 18, 2002Samuel R. Neff Automation Control one application from another Use COM object “Word.Application” Complete flexibility and power Limitations –Unattended execution –Slow –CF COM Support (all versions)
4
Serving Word September 18, 2002Samuel R. Neff Document Properties Small quantities of data Very fast and easy to use Safe for servers Limitations –CF COM Support (all versions) –Java version incomplete (Apache POI)
5
Serving Word September 18, 2002Samuel R. Neff HTML, XML, CSS Familiar Fast Flexible
6
Serving Word September 18, 2002Samuel R. Neff Hello Word Standard HTML document Hello! I'm a Word document. Display in MS Word <cfheader name="Content-Type" value="application/msword"> <cfheader name="Content-Disposition" value="attachment; filename=HelloWord.doc"> Example: helloword.cfm
7
Serving Word September 18, 2002Samuel R. Neff Basic Formatting Sections Pages Margins @page Section1 { size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; } div.Section1 { page:Section1; } Example: letter01.cfm
8
Serving Word September 18, 2002Samuel R. Neff Paragraph Formatting Namespaces Text wrapping Margins p { margin:0pt; } Orphan control p { mso-pagination:widow- orphan; } White spaces style='mso-spacerun:yes' Example: letter02.cfm
9
Serving Word September 18, 2002Samuel R. Neff Labels Tables fixed layout mso-table-layout-alt: fixed; Don't break rows Specify row height page-break-inside: avoid; height: 1.0in; Fixed width label cells width: 189.0pt; Spacer cells width: 9.0pt; Paragraph margins margin: 0in 5.3pt 0in 5.3pt; Example: labels01.cfm
10
Serving Word September 18, 2002Samuel R. Neff Advanced Labels Different sizes and layouts –Page Margin –Row Height –Paragraph Margins –Number of Columns –Spacers Reuse code –Despite varying content –ColdFusion Components Not all labels can be generated Examples: labels02.cfm, labels03.cfm, WordLabelGenerator*.cfc
11
Serving Word September 18, 2002Samuel R. Neff Columns Columns style on page mso-columns:2 even.5in; Sections to separate columns and standard layout text @page Section1 {} @page Section2 {} Paragraph margins for spacing margin-bottom:12.0pt; Breaks to divide document sections Div tags to identify sections Example: columns01.cfm
12
Serving Word September 18, 2002Samuel R. Neff Multi-File Documents Web Archives (Multipart MIME) MIME-Version: 1.0 Content-Type: Header part ignored This is a Multipart MIME... Boundary between parts ------=_edb95f2d9c Location of each part Content-Location: Encoding type Content-Transfer-Encoding: Encoded message parts Message parts Include a list of files filelist.xml Examples: MultipartMIME_Example.htm, MultipartMIME.cfc
13
Serving Word September 18, 2002Samuel R. Neff Headers & Footers File links Margins mso-header-margin:.5in; mso-footer-margin:.5in; URLs mso-header: url("…") h1; mso-footer: url("…") f1; Style attribute mso-element: header ID id="h1" Example: columns02.cfm
14
Serving Word September 18, 2002Samuel R. Neff Images Use standard tag Include image in the file list Include image in Multipart MIME message –Component automatically encodes as Base64 Example: columns03.cfm
15
Serving Word September 18, 2002Samuel R. Neff Resources Save as Web Page Microsoft ® Office HTML and XML Reference –http://msdn.microsoft.com/library/default.asp?url=/libr ary/en-us/dnoffxml/html/ofxml2k.asp RFCs 2045 and 2046 –http://www.ietf.org/rfc/rfc2045.txt –http://www.ietf.org/rfc/rfc2046.txt
16
Serving Word September 18, 2002Samuel R. Neff Conclusions HTML/XML/CSS Faster and more stable than COM Can be used for most dynamic Word applications Builds upon existing developers' skill set
17
Serving Word September 18, 2002Samuel R. Neff Questions sam@blinex.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.