Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
from txp to rtf? any ideas or alternatives?
I’d like to use txp to organise a collection of items that need to printed out onto cards of a fixed size with a particular layout. Print output from HTML is just too inconsistent across browsers etc. and one has little control of layout, margins etc.
On the now sadly stagnating SideJobTrack Invoicing Webapp, the author R. Marie Cox had a wonderful export to RTF feature that took fields from the system and merged them into an RTF template, so that you had a print-ready file exactly according to your own styling.
Does anyone know of any libraries that would work with txp/PHP for this and allow a degree of layout control? Would there be an alternative approach, e.g. via an XML-Word/OpenDoc structure??
TXP Builders – finely-crafted code, design and txp
Offline
#2 2008-02-28 14:59:38
- ultramega
- Member
- Registered: 2006-02-26
- Posts: 221
Re: from txp to rtf? any ideas or alternatives?
I’m not any kind of expert of these things, and not exactly sure what you are looking for – but 1) are you making single print-run by yourself 2) or is the feature meant to be in use in future for end-users?
If case 1, you could perhaps export your database as excel, then combine needed txp-fields to blocks of text (I have done quite similar thing lately). Then import them to your layout-program. If you are using InDesign to lay-out your cards, there is a great feature called “data merge” which can be helpful if printing sligthly changing items.
Don’t know if this is helpful at all :)
Offline
Re: from txp to rtf? any ideas or alternatives?
Good thinking Ultramega (I’ve used InDesigns data merge before in a similar way) but in this case it’s case 2: the users should be able to click – download card, then print it out back-on-back themselves. The cards have to go in a particular sized box, hence the need to control the layout.
More ideas anyone?
Last edited by jakob (2008-02-28 15:13:34)
TXP Builders – finely-crafted code, design and txp
Offline
#4 2008-02-28 15:45:48
- ultramega
- Member
- Registered: 2006-02-26
- Posts: 221
Re: from txp to rtf? any ideas or alternatives?
Ok. How about this plugin? Propably doesn’t give you enough possibilities to affect layout?
Offline
Re: from txp to rtf? any ideas or alternatives?
Thanks, I suspect you’re right regarding control, but it does say something about diverting it through another css file, so it maybe worth a whirl if one builds a really tight indestructable layout…
Still on the lookout for an RTF solution, or similar.
TXP Builders – finely-crafted code, design and txp
Offline
Re: from txp to rtf? any ideas or alternatives?
You could do it manually…sort of (see the RTF pocket guide). I haven’t worked with RTF, but the syntax is pretty similar to LaTeX (just more finicky). Ripped from the pocket guide:
<txp:hide>page template</txp:hide>
{\rtf
{\fonttbl{\f0 Times New Roman;}}
<txp:article form="rtf"/>
}
<txp:hide>form: rtf</txp:hide>
\f0\fs60 <txp:title/>
Of course you’d need to send the header as uh, whatever the RTF header is! You could also try PhpRtf, but it seems a little too complicated.
I do think a PDF is the best solution – if wan_pdf doesn’t work out, use XML+XSLT+XSL:FO (FOP) to generate a PDF. It might be a little too much trouble though (but it is fun!).
Offline
#7 2008-02-29 18:47:30
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Re: from txp to rtf? any ideas or alternatives?
If only a Server License wouldn’t be 3800$, I would use Prince for the Job.
(E.g.: Make the conversion from either XHTML or XML on the Fly with CSS formatting for output)
I think I wouldn’t use RTF, because it mixes content with formatting data which makes those documents sort of inaccessible. (On the other Hand, a final PDF is such a case as well, but still better, I think )
regards
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline