uzaemon's BBS

Hosted by freeforums.org
It is currently Mon Dec 07, 2009 5:13 am

All times are UTC



Welcome
Welcome to <strong>uzaemon's BBS</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: TIFF2PDF V5R4
PostPosted: Fri Mar 06, 2009 12:51 pm 
Offline

Joined: Fri Mar 06, 2009 12:38 pm
Posts: 5
Hi all,

we just tried the command on an iSeries with V5R4 but unfortunately the pdf we create is completely white (but its about 150kb) while the tiff is correct.

We also tried to run the command using a tiff generated from a V5R3 but nothing changed.

We lastly tried to generate the tiff and to run tiff2pdf on a v5r3 and the pdf is correct, so it seems the tiff2pdf command on our v5r4 has some kind of problem.

Anyone else have had this problem solved?

Thanks in advance,
Monia


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 06, 2009 1:49 pm 
Offline

Joined: Fri Mar 06, 2009 12:38 pm
Posts: 5
It seems we've found the solution. In V5R4 the sysval QLOCALE is set to /QSYS.LIB/XX_XX.LOCALE where XX is the base language, but in the previous OS versions it was set at *NONE. So we just set it that way and tiff2pdf command worked again.

Thanks for reading.
Monia


Top
 Profile  
 
 Post subject: Information from old BBS.
PostPosted: Mon Mar 09, 2009 10:43 am 
Offline
Site Admin

Joined: Tue Jan 29, 2008 3:09 am
Posts: 47
Monia,

Thank you very much for your help! :D
Below is an excerpt from old BBS. Please read if interested.

uzaemon@Japan


Quote:
04565/04565 AAA00000 uzaemon Re: Problem on V5R4 TIFF2PDF
( 1) 07/04/17 22:18 Comment on 04494

> Dear Uzaemon, recently i passed my Iseries on V5R4 release and from that moment your utility don't run correctly. The PDF files generated results damaged.
> I read the post 1658 and seems to be the same problem but i don't understand the solution.

IBM has changed the default behavior of C runtime functions. For detail, see "Memo to users" (http://publib.boulder.ibm.com/infocente ... /rzaq9.pdf), Page 12, "QLOCALE system value set to default locale during installation" and page 534 of "WebSphere Development Studio: ILE C/C++ Programmer's Guide" (http://publib.boulder.ibm.com/infocente ... 092712.pdf). As a result, period is translated to comma in some circumstances as follows :

(*LIBL/QCSRC.LOCALE)
Code:
#include <stdio.h>
char buffer[10];

int main(void)
{
  sprintf(buffer, "%f\n", 123.45678);
  printf("value = %s\n", buffer);
}


> CRTBNDC PGM(LOCALE)
> CHGUSRPRF USRPRF(A) LOCALE('/qsys.lib/fr_fr.locale')

Open another 5250 session and sign-on as user A.

> call locale

value = 123,456780

----------

Having that said, there are several ways to fix this problem.

1) Compile the C modules specifying LOCALETYPE(*CLD).

2) Specify other locale for USRPRF, e.g., exec CHGUSRPRF USRPRF(A) LOCALE(*C). Other locales such as POSIX, EN_US, *NONE may also work.

3) Set locale explicitly in C program.

Add a few lines to main().

(*LIBL/QCSRC.LOCALE2)
Code:
#include <locale.h> //// Add
#include <stdio.h>
char buffer[10];

int main(void)
{
  setlocale(LC_ALL, "C"); //// Add
  sprintf(buffer, "%f\n", 123.45678);
  printf("value = %s\n", buffer);
}


> CRTBNDC PGM(LOCALE2)

For more information of the setlocale(), check out page 322 of "ILE C/C++ Run-Time Library Functions" (http://publib.boulder.ibm.com/infocente ... 415607.pdf).

There are other ways :
- Change system value QLOCALE
- Control the locale using environment variables
- Compile TIFF2PDF on V4R5 and earlier

Try whichever you like and let me know the result.
Waiting for your feedback.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
cron