wxPdfDocument - ALIGN_LEFT problem  [SOLVED]

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
patverner
Earned a small fee
Earned a small fee
Posts: 11
Joined: Wed Mar 01, 2006 7:57 pm
Location: Gauteng, South Africa
Contact:

wxPdfDocument - ALIGN_LEFT problem

Postby patverner » Mon Mar 06, 2006 5:53 pm

I am trying to create a report using wxPdfDocument.

The report is a single page; with about 4 lines of headings, which are created with
Cell( ....,wxPDF_ALLIGN_CENTER).

The report lines are then created using separate Cell call for each of 6 fields. The first 2 columns are "wxPDF_ALIGN_RIGHT", the remaining fields are "wxPDF_ALIGN_LEFT"".

However, on both Linux (wxGTK-2.6.1) and Win98 (wxMSW-2.6.1) the 3rd field is generated as "ALIGN_CENTER"! If I change the call to ALIGN_RIGHT, then it goes to the right, but using ALIGN_LEFT it insists on CENTERing the text field!

A brief look at the code in pdfdoc.cpp doesn't give me any hints - it should work, but doesn't!

Any suggestions would be wecome. My code available on request (is selecting the report data from a MySQL database).

=Pat

utelle
Moderator
Moderator
Posts: 828
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxPdfDocument - ALIGN_LEFT problem  [SOLVED]

Postby utelle » Mon Mar 06, 2006 7:16 pm

patverner wrote:I am trying to create a report using wxPdfDocument.

The report is a single page; with about 4 lines of headings, which are created with
Cell( ....,wxPDF_ALLIGN_CENTER).

The report lines are then created using separate Cell call for each of 6 fields. The first 2 columns are "wxPDF_ALIGN_RIGHT", the remaining fields are "wxPDF_ALIGN_LEFT"".

However, on both Linux (wxGTK-2.6.1) and Win98 (wxMSW-2.6.1) the 3rd field is generated as "ALIGN_CENTER"! If I change the call to ALIGN_RIGHT, then it goes to the right, but using ALIGN_LEFT it insists on CENTERing the text field!

A brief look at the code in pdfdoc.cpp doesn't give me any hints - it should work, but doesn't!

Any suggestions would be wecome. My code available on request (is selecting the report data from a MySQL database).

Without seeing the code - and possibly the resulting PDF file - it's hard to say what's going wrong in your program. It definitely should work. And it does in the sample programs. (If you provide the resulting PDF file, please use SetCompression(false) when creating it, otherwise I'm not able to analyze it)

Regards,

Ulrich

Edit: The problem was not related to wxPdfDocument but was caused by how strings retrieved from the database were formatted. They had leading blanks giving the impression they weren't left aligned.


Return to “wxCode”

Who is online

Users browsing this forum: No registered users and 3 guests