ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Convert Spool File to PDF

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    By the way welcome stuart

    I am guessing your source file is only 92 in width.....


    when you use the CRTSRCPF it defaults to 92
    Code:
                         Create Source Physical File (CRTSRCPF)           
                                                                          
     Type choices, press Enter.                                           
                                                                          
     File . . . . . . . . . . . . . .                 Name                
       Library  . . . . . . . . . . .     *CURLIB     Name, *CURLIB       
     Record length  . . . . . . . . .   92            Number              
     Member, if desired . . . . . . .   *NONE         Name, *NONE, *FILE  
     Text 'description' . . . . . . .   *BLANK

    You must have your source file at 112 cause that the extra wide length required for RPGLE.....

    so try this
    Code:
    CRTSRCPF FILE(QTEMP/TESTSOURCE) RCDLEN(112) TEXT('my stest source')
    then this (you have to change to your names)
    Code:
    CPYFRMPCD FROMFLR(SCG) TOFILE(QTEMP/TESTSOURCE)  
    FROMDOC(SOMEFILE.TXT) TOMBR(SOMEFILE)

    Oh and make sure the type in PDM is also RPGLE

    Code:
    MSC57       RPGLE       check-out source
    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #32
      Very strange, the src pf is 112 and everything is fine, all data is shown as it should be and then when i change the member to RPGLE, i lose data to the left and get the resulting data as below;
      This is a cut and paste of how the member looks at the end,... any data that appeared to the left of the specs is chopped out..

      d SpceLines PI
      d isSpceLine LIKE(ssSpceLine)

      d liCount S 5I 0

      c EVAL wiLine = wiLine + 1
      c EVAL saOutput = *BLANKS
      c DOW liCount < isSpceLine - 1
      c WRITE cvtwork01 OutputData
      c EVAL wiLine = wiLine + 1
      c EVAL liCount = liCount + 1
      c ENDDO

      c RETURN

      p SpceLines E

      ><head><title>xxxx</title></head><body>
      e><tr><td> <pre>

      ></td></tr></table></body></html>



      any ideas, maybe a setting on the system?

      Comment


      • #33
        RPGLE just does that its normal

        Use the F19 (shift F7) to see the data to the left......


        Its fine just compile it and enjoy....


        Jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #34
          Ah! Thanks for your patience, compiled and working fine now....

          Hopefully someone can work out how to change the RPGLE PDF source so we can convert 198 width reports to PDF! The HTML version is ok at converting 198 width reports... I take it the coding is harder to create 198 width PDF reports?

          Thanks for your help

          Comment


          • #35
            Your welcome

            I will try to set some time aside and get this working....It was only a starting point...always hoped someone else would complete it

            anyway welcome
            Hope to see more of you on the forums...


            If you have some source laying around you can post it here also.



            take care
            Jamie
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #36
              Re: Convert Spool File to PDF

              I have change the code so that it will take a 192 long spooled file into a PDF. It has to do with the CPI of the spooled file. I have one at 15 or 150 in siCPI and another at 20 or 200 in siCPI.

              I made the code change in the NewPage Procedure - change I did is bellow (changed the 150 to be 6 and then added the 200 at a 6. It works fine but I am having an issue printing, some reason on line 10 adobe errors - ill figure it out.


              0709.00
              0710.00 C SELECT
              0711.00 C WHEN siCPI = 50
              0712.00 C CALLP WritePDF('/F1 20 Tf')
              0713.00 C WHEN siCPI = 120
              0714.00 C CALLP WritePDF('/F1 9 Tf')
              0715.00 C WHEN siCPI = 150
              0717.00 ski> C CALLP WritePDF('/F1 6 Tf')
              0718.00 ski< C* CALLP WritePDF('/F1 8 Tf')
              0719.00 C WHEN siCPI = 167
              0720.00 C CALLP WritePDF('/F1 6 Tf')
              0720.01 ski> C WHEN siCPI = 200
              0720.02 ski> C CALLP WritePDF('/F1 6 Tf')
              0721.00 C OTHER
              0722.00 C CALLP WritePDF('/F1 10 Tf')
              0723.00 C ENDSL

              Comment


              • #37
                Re: Convert Spool File to PDF

                livetoski,


                Great! glad to have your help......Please send back your finished version I will overlay the old one and add in your by line.....

                Thanks again for the help
                Jamie
                All my answers were extracted from the "Big Dummy's Guide to the As400"
                and I take no responsibility for any of them.

                www.code400.com

                Comment


                • #38
                  Re: Convert Spool File to PDF

                  I would like to figure out why adobe fails on the print justt in case it is a program issue. As soon as I confirm/fix the error i will psot the code.

                  Ski hard!

                  PS: good stuff!

                  Comment


                  • #39
                    Re: Convert Spool File to PDF

                    Jamief,

                    OK - i found my error - My issue, incase anyone has this, is where the first page is a header and we never use it. So, i changed the PDFPages proc to ignore the first page but did not adjust the siPages field by 1. Adobe was looking for 4 pages and would error out as soon as it tried to process the print on the 4th page. So, i added a check to the PDFHeader Proc and subtracted siPages by 1 and away i go..

                    To post the code would you like only the CVT2PDF, since that is all I changed, and in what format.

                    Comment


                    • #40
                      Re: Convert Spool File to PDF

                      This is good news, thankyou also from me for looking into the pdf issue. Hope you get the printing issue fixed!

                      Stuart

                      Comment


                      • #41
                        Re: Convert Spool File to PDF

                        Just post it here......



                        under type other and I will take care of it......





                        Thanks
                        Again


                        Jamie
                        All my answers were extracted from the "Big Dummy's Guide to the As400"
                        and I take no responsibility for any of them.

                        www.code400.com

                        Comment


                        • #42
                          Re: Convert Spool File to PDF

                          Hi

                          Is this new source ready for download? I downloaded the source files from the location before, but the file dates seem to be the same. Sorry if im jumping the gun here!

                          Thanks
                          Stuart

                          Comment


                          • #43
                            Re: Convert Spool File to PDF

                            Stuart,

                            We havent posted the new source yet....

                            When I get it on the system I will make a post here.

                            Sorry for the delay

                            Thanks
                            Jamie
                            All my answers were extracted from the "Big Dummy's Guide to the As400"
                            and I take no responsibility for any of them.

                            www.code400.com

                            Comment


                            • #44
                              Re: Convert Spool File to PDF

                              Hi

                              did this modified source get uploaded?

                              Thanks
                              Stuart

                              Comment


                              • #45
                                Re: Convert Spool File to PDF

                                Stuart,

                                I just send livetoski an email waiting for his reply.
                                When I get it I will send you an email

                                Jamie
                                All my answers were extracted from the "Big Dummy's Guide to the As400"
                                and I take no responsibility for any of them.

                                www.code400.com

                                Comment

                                Working...
                                X