You are here: Re: textarea fields --> export to ms word --> word is stretch « All PHP « IT news, forums, messages
Re: textarea fields --> export to ms word --> word is stretch

Posted by Steve on 03/02/07 17:02

"Eric Layman" <namyalcire[at no spam]gmail.com> wrote in message
news:1172854530_4409@sp6iad.superfeed.net...
| Hi,
|
| I have fields from textareas.
|
| With a click of a button, php is able to grab these fields and by using
| header(), convert the output to Ms Word doc.
|
| But the outcome of the word doc doesn't wrap the text in textarea.
|
| the result is one very veyr long string of text which stretch MS word all
| the way
|
| how to over come that?
|
| I've tried different wrap attributes.

hard to say without looking at the code you're using.

are you on a windows server? are you creating a com ms word doc object and
putting the text in that way? or, are you creating a standard text file and
calling it word (i.e. someDoc.doc or setting the header for the browser as
an ms word doc)?

if on windows, i'd go the com route and remove any soft-returns that may be
in the text. then, i'd use word's om to format the boundries, color, font,
etc. of the text as it should appear in word. what is word's om? the easiest
way to get what you need is to open word, record a macro, type and format
some text the way you want it to look as if it were really your output, stop
recording your macro. from there, just edit the macro. you will see the
source code and see all the methods/properties you will need to know and
work with. problem solved.

if not on windows, i'd get a good conversion tool, and even think about
using xml/xslt as an abstraction layer. that combination will allow you not
only to convert to word but to pdf and others as well.

anyway, hth.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация