These past three tips I've struggled to get the programs on my Iserver. I'm coping the files to my PC then using the CODE program I copy and compile the programs on my 270. If anyone has a better or faster way please let me know. I was able to get this tip to work great, I've tried others using Itext and was unable to get them to work. Thank You, Scott
Unconfigured Ad Widget
Collapse
TechTip: TechTip: Spooled Files and PDF, Part Three
Collapse
X
-
TechTip: TechTip: Spooled Files and PDF, Part Three
This is a great utility Giuseppe! We have been using the "Part 1 Version" since shortly after Midrange Computing published it. However we have had a few problems with authority in the IFS for our users whenever their job creates a PDF with this tool. Namely two problems; 1) The Group authority is lost whenever the PDF is recreated in our desired directory. 2) The Public authority is lost for 'existence' whenever the PDF is recreated. Now, I do know that IFS security/authority can be a tricky thing to deal with, and there is a whole hiearchical structure to follow from the folders on down, but I do think there was something missing from the code that could help remedy this situation. But I'm not an expert! Solution to Problem #1? ------------------------ I think I may have solved the problem for #1 above, group authority not transferred; In looking at the code in RPG program SCS2PDFR, there is a statement to create the stream file, which is; // Open(Create) stream file fd = open(%Addr(Filename) : O_CREAT + O_WRONLY + O_TRUNC + O_CODEPAGE : S_IRWXU + S_IROTH : 819); It appears to be missing the parameter for group authority in the "S" variables. It handles 'owner' and 'other', but I propose adding this parameter S_IRWXG for 'group' authority like so; fd = open(%Addr(Filename) : O_CREAT + O_WRONLY + O_TRUNC + O_CODEPAGE : S_IRWXU + S_IROTH + S_IRWXG : 819); Defining it in the variables in the same program like so; 0066.00 D S_IRWXG S 10I 0 INZ(56) This seemed to take care of my problem with group authority. I hope this will help other people who may be having a similar problem. And please correct me if I'm wrong too! Or if I am not clear. However, I'm still trying to figure out a solution to #2, which is that I want to create the stream file with 'existence' authority for *public so that the next person to come along and run this job can delete it or 'unlink' it. Currently whenever a PDF is created with this tool (by anyone) in the desired directory, *public comes away with only 'read' authority. This creates a problem when the next user comes along and tries to 'Unlink' it because they do not have the authority.
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
Restating my problem #2 from above; Our problem comes from the fact that our users do not have object existence authority to most directories in our IFS. This utility then proceeds to 'hiccup' on the section of code that performs an unlink (or delete) of the PDF file if it exists. So I did two things, and I'd love to hear some feedback on them. A: I commented out the code that performs the Unlink. There are two parameters on the open command that will create the command if it does not exist, and clear the file if it does. These parameters are the O_CREAT and O_TRUNC parameters respectively. I wonder what I am missing by removing this code? But I also wonder how anyone else's system will allow a user to delete something from their IFS? (See commented out code below) B: I changed the open (Create stream file) to the sample given in the code. noteably adding the public authority to write to the file with the variable S_IWOTH.
Code
Comment
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
sorry, I made a typo that could be confusing. Where I said; "There are two parameters on the open command that will create the command if it does not exist." I should have said; "There are two parameters on the open command that will create the 'stream file' if it does not exist." sorry for any confusion.
Comment
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
Giuseppe, This is a really slick utility that works great for us. Most important - the BOSS loves it! All I did to modify the original version was to put a front end on it where the user does little else than select the spool files they want, then it submits a batch job that runs unattended. Thanks so much for your contribution! Rich
Comment
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
To run unattended converters you can - crtoutq outq(outqpdf) dtaq(dqspool) - crtdtaq dtaq(dqspool) maxlen(128) - create a cl program that listens do dtaq ... call QRCVDTAQ (&dqspool &dqlib &datalen &data &wait) if (%sst(&data 1 10) *ne *SPOOL) goto endpgm chgvar &job %sst(&data 13 26) chgvar &splf %sst(&data 39 10) chgvar &splfn %sst(&data 49 4) chgvar &jobname %sst(&job 1 10) chgvar &jobuser %sst(&job 11 10) chgvar &jobnbr %sst(&job 21 6) chgvar &splfnbr %bin(&splfn 1 4) SPL2ITEXT ...... Before printing you can override your prtf to go to the outq you created and put additional instructions (like the destination path) in the USRDFNDTA parameter The clp that listens to the dtaq retrieves the USRDFNDTA running api QUSRSPLA (at offset 1157). Beppe.
Comment
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
I have been following this progress of this utility and until now have been pretty happy with the result. I have just complied and tested the new java based command, and was surprised to find that it seems to suck up system resources, when using the sample gif file. I have used the suggested optimization, from the article, but it still just eats up system resources. (The System Admin isn't happy!) Did I miss something?
Comment
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
- use parameter JDEBUG(*YES) to get the full error details. - make sure that SCS2ITEXTC and SCS2ITEXTO have the right iText library in the classpath - use SCS2ITEXTO to recompile the SCS2ITEXT.class - run CRTJVAPGM against the iText jar
Comment
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
Hello Guiseppe, Thanks a million. I'ts working like a charm. I had to change itext-1.2.jar to itext-1.3.jar as I had downloaded the latest version. One more request, we have a small logo which is normally printed on the top left corner. How can I achieve this ??? Thanks & best regards Ewart
Comment
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
change the parameter LOGO in the SCS2ITEXT cmd: PARM LOGO TYPE(*CHAR) LEN(10) RSTD(*YES) DFT(*NONE) + VALUES(*NONE *TOPLEFT *LEFT *TOP *RIGHT *BOTTOM) + PROMPT('Print logo') Change the CLLE SCS2ITEXTC : increase the size of the &LOGO variable to 10 and force the value '0' for *TOFLEFT: IF (&LOGO = *TOPLEFT) CHGVAR &LOGO '0' ELSE CHGVAR &LOGO %SST(&LOGO 2 1) Change the SCS2ITEXT.java and add this in the method addLogo: } else if (LOGO.equals("0")) { offsetX = 0; offsetY = offsetY - imageHeight; } Run SCS2ITEXTO to recreate the class.
Comment
-
-
TechTip: TechTip: Spooled Files and PDF, Part Three
Hello Guiseppe! Your SCS2iTEXT and SCS2PDF utilities are really great!!! You probably don’t remember me, we are correspond before about a year, I have been trying then to start SCS2PDF utility (from part one), but it was my mistake – I have created CPYSPOOL with wrong attributes – don’t ask me howWell, my boss then put me on other jobs and whole thing was postponed. Recently, my boss remembered that we didn’t solve problem (converting spool to PDF) and I must solve this. Today I’m smarter then before one year… SCS2PDF works for me perfectly, but problem is that I can’t get Croatian letters in PDF. For this reason I now trying with SCS2iTEXT utility, things are a little bit better, now I can’t get only 4 Croatian letters. Is there a way to select another font or use another CCSID table on iSeries? On SCS2PDF I didn’t manage to get Croatian letters with other CCSID table… Except this little problem SCS2iText works perfectly and I’m enjoy to use it! Please help me to solve this problem. Best regards, Dalibor
Comment
-
Comment