Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Printing fails in german locale
Printing fails in german locale
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
chrillek
Blue Pill


Joined: May 06, 2008
Posts: 2

PostPosted: Tue May 06, 2008 3:26 am    Post subject: Printing fails in german locale

Hi,

I'm using Neooffice 2.2.3 patch 2 on Mac OS X 10.5.2. Printing is via CUPS to a Kyocera FS-800 connected to a linux box and it works ok from all applications - with the notable exception of Neooffice.

Usually the Mac is running in a German locale (i.e. the decimal separator is ","). When I try to print any document from Neooffice in this situation, I see error messages like this in the CUPS error log:

Code:

D [06/May/2008:12:04:59 +0200] [Job 1953] Error: /undefined in 56,88
D [06/May/2008:12:04:59 +0200] [Job 1953] Operand stack:
D [06/May/2008:12:04:59 +0200] [Job 1953] --nostringval--   1   0   0   1
D [06/May/2008:12:04:59 +0200] [Job 1953] Execution stack:
D [06/May/2008:12:04:59 +0200] [Job 1953] %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
D [06/May/2008:12:04:59 +0200] [Job 1953] Dictionary stack:
D [06/May/2008:12:04:59 +0200] [Job 1953] --dict:1134/3371(ro)(G)--   --dict:0/20(G)--   --dict:89/200(L)--   --dict:62/75(L)--   --dict:12/15(L)--   --dict:0/15(L)--   --dict:3/15(L)--   --dict:0/15(L)


When I change the locale setting of the Mac (via System Settings/International) to English and make sure that the decimal separator is "." (point!), printing from Neooffice works ok.

A similar bug existed years ago in Staroffice. I suppose that the printf statement(s) used to generate the PDF code in Neooffice do not set the locale to "C" so that in a German locale all floating point numbers are generated with a "," as decimal separator instead of ".".

The workaround for me is to select "print to PDF" from the standard Mac print dialog and then print the PDF file from "Preview" - that works ok. However, printing from Neooffice directly should be possible too - I think.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue May 06, 2008 9:01 am    Post subject: Re: Printing fails in german locale

chrillek wrote:
When I change the locale setting of the Mac (via System Settings/International) to English and make sure that the decimal separator is "." (point!), printing from Neooffice works ok.

A similar bug existed years ago in Staroffice. I suppose that the printf statement(s) used to generate the PDF code in Neooffice do not set the locale to "C" so that in a German locale all floating point numbers are generated with a "," as decimal separator instead of ".".


This is very odd. However, since we do not use printf or any other hacky methods to print (we use the standard Cocoa drawing APIs to draw to a Cocoa print view) and there are no locale functions for Cocoa's NSViews or its subclasses, the C API functions that you mention are not applicable to printing. It would seem odd that Mac OS X's Cocoa drawing APIs are sensitive to the C locale setting. Most likely, your print driver is the cause of this problem.

Since printing to a PDF file and printing to Preview work for you, can try setting up a new printer in the System Preferences application's Print and FAX icon? When you setup the printer this way instead of going directly through CUPS, does the problem still occur?

Here is some more background on why I think your print driver is the problem:

When printing to PDF or Preview, there is no difference in our code and we use the same exact code for all print operations. In all cases, the Mac OS X Cocoa drawing functions will convert the drawing instructions to PDF and put the PDF file on disk. The only difference when printing to a printer is that that PDF file on disk is streamed to your printer driver which, in this case, is CUPS.

I understand that this problem only happens with NeoOffice. However, that does not eliminate the print driver as the cause. What it probably points out is that NeoOffice does some drawing operations that other applications rarely do. The most common drawing operation that NeoOffice does is glyph scaling so I suspect that the glyph scaling PDF tags that Mac OS X puts in the PDF are not being handled properly by your driver.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue May 06, 2008 12:08 pm    Post subject:

If setting up the printer through the System Preferences application's Print and Fax icon does not change anything, I have some more data that may help.

I put a printf in my code that prints the output of the setlocale( LC_ALL, NULL ) function. When the preferred language is set to either English or German in the system preferences application, this function always returns the following:

Code:
en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8


Since the setlocale() output is constant with different languages, we can eliminate that as the cause.

Nevertheless, I have one more thing that you can try: disable German in the list of NeoOffice languages. To do this, use the following steps:

1. Quit NeoOffice
2. Control-click on the NeoOffice application icon in your /Applications folder and in the popup menu that appears, select the Get Info menu
3. In the dialog that appears, expand the Languages section and uncheck the "de" entry.
4. Restart NeoOffice

If doing the above makes the problem stop, then reenable the "de" entry and find your print driver's installation directory. Within that directory, search for any German.lproj or de.lproj folders. Move any that you find to disable German support for your print driver. Restart NeoOffice and try printing.

Does any of the above help?

Patrick
Back to top
chrillek
Blue Pill


Joined: May 06, 2008
Posts: 2

PostPosted: Thu May 29, 2008 8:21 am    Post subject: Fixed

Sorry for being so long with that. I followed the first advice and added a printer through the Print&Fax dialogue (had to use the "advanced" options in order to be able to print through http to the CUPS server). Anyway, it works ok now.

Weird, since Neooffice (and OpenOffice 3 Beta as well, fwiw) are the only applications where I experienced this problem.

Anyway, thanks for your help!
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.