DCPRINT RTF question

This forum is for eXpress++ general support.
Post Reply
Message
Author
skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

DCPRINT RTF question

#1 Post by skiman »

Hi,

Customers are asking to have more possibilities when they enter data into a memofield. They would like to use at least bold or Italic in descriptions of products. This isn't a problem with DCRTF which can be adapted to their needs.

I thought I could use the dcprint RTF to print this on documents. If the description must be printed on invoices, i need to use the dcprint RTF. In my test it looks as this isn't working as expected.

Some questions:
- Can DCPRINT RTF be used to print in combination with other DCPRINT commands on the same page? I tried this with the invoice.prg in the samples\printer folder, and it doesn't work for me.
Added the below code at line 500 in invoice.prg.

Code: Select all

// Print RTF
cRtf := memoread("test.rtf")
@ 1,1,50,10 dcprint RTF cRtf
- Anyone who has another method to accomplisch this? When entering text use of BOLD and ITALIC, and the possibility to print this as part of a document?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCPRINT RTF question

#2 Post by rdonnay »

This may be difficult, but I will look into it.

DCPRINT RTF uses the PrintRect() method of the XbpRtf() class and this may interfere with things.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: DCPRINT RTF question

#3 Post by skiman »

Hi Roger,

I'm working on a solution for this. Since the RTF is a text file I can read, I can solve it by interpreting the codes in it.

Don't loose your time with it. Maybe someone had already a solution out of the box. That's why I asked the question.
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: DCPRINT RTF question

#4 Post by skiman »

Hi,

Meanwhile I succeeded to implement this. In attachment a PDF sample where a 'normal' memo field is printed, and a memo field with RTF content.

For my application I only need to have the Bold, Italic and Underline as extra options for product descriptions. It would also be possible to implement different fonts.

In short:
- Read the RTF as TXT and replace the codes you need, in my case \b , \b0 , \i , \i0 , \ul , \ulnone .
- Load it in an xbprtf.
- Get the oRtf:text
- Process it.

Since I can't upload PDF files, the PDF is included in the ZIP.
Attachments
O001848.ZIP
Print RTF
(352.99 KiB) Downloaded 142 times
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCPRINT RTF question

#5 Post by rdonnay »

Very nice work!!!
The eXpress train is coming - and it has more cars.

Post Reply