ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CVT2CMD margin on PDFs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CVT2CMD margin on PDFs

    Just recently found the CVT2CMD for genrating PDFs. Love the tool... and my user's love it too. We've been converting sales reports to PDF to distribute via email instead of killin trees.

    I do have a question about the lack of a margin in the PDFs. Is this a setting in Acrobat reader or is it in the PDF code?

    Thanks,

    Rob
    Attached Files

  • #2
    Re: CVT2CMD margin on PDFs

    No Takers?

    Comment


    • #3
      Re: CVT2CMD margin on PDFs

      I believe Jamie is our resident expert on that piece of software. However, he's on holidays this week.

      Actually even if it wasn't his area I believe the standard rule in is "blame it on the guy who just left the company and assign to the one on holidays"

      Comment


      • #4
        Re: CVT2CMD margin on PDFs

        Someone needs to identify the adobe code for left margin then we just add to RPG program. I will look and see what I can find will take any help

        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


        • #5
          Re: CVT2CMD margin on PDFs

          ineeded to include some margin myself...and stumbled into fixing the code ...

          just include the line 0433.01 as shown below in your CVT2PDF pgm (you can include as many spaces as you want depending on how big of a margin you need)....

          0428.00 * Output the line of text
          0429.00
          0430.00 C CALLP WritePDF( %trim(NumToText(liX))
          0431.00 C + ' '
          0432.00 C + %trim(NumToText(liY))
          0433.00 C + ' Td ('
          0433.01 C + ' '
          0434.00 C + %trimr(saInput)
          0435.00 C + ') Tj')
          0436.00
          0437.00 C READ cvtwork02 InputData LR
          0438.00 C ENDDO
          0439.00
          0440.00 C CALLP EndPage
          0441.00
          0442.00 P PDFPages E
          0443.00

          Comment


          • #6
            Re: CVT2CMD margin on PDFs

            Thanks SG,

            This'll work.

            Rob

            Comment


            • #7
              Re: CVT2CMD margin on PDFs

              I will put this fix in to original code someday


              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


              • #8
                Re: CVT2CMD margin on PDFs

                one other thing i ran into was when i increased the margin size...the portion of the spool on the right hand side got cut off a bit..(in cases where the spool is full 132 chrs long)... u could adjust the font size in that case and it works like a charm

                here is the code where u cud change the font size...

                * Determine font size to use from Characters per inch setting

                C SELECT
                C WHEN siCPI = 50
                C CALLP WritePDF('/F1 19 Tf')
                C WHEN siCPI = 120
                C CALLP WritePDF('/F1 8 Tf')
                C WHEN siCPI = 150
                C CALLP WritePDF('/F1 7 Tf')
                C WHEN siCPI = 167
                C CALLP WritePDF('/F1 5 Tf')
                C OTHER
                C CALLP WritePDF('/F1 9 Tf')
                C ENDSL


                u can change the numbers i marked in bold...to a smaller value...

                (bless jamie for giving us such a nice tool


                P NewPage E

                Comment


                • #9
                  Re: CVT2CMD margin on PDFs

                  alright here are your changes I added a left margin on the command hit <F9> for more options its the last one. V5R3 in savf
                  Attached Files
                  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


                  • #10
                    Re: CVT2CMD margin on PDFs

                    Hi Jamie,
                    Just recently downloaded the utility and it is working good. But i also encountered the problem for spool files with widths more than 132. I have done some search on this forums and found this thread. Unfortunately we are on v5r2mo. Can you post the save file for our version please? Does it have the source code in the save file.
                    Thanks a lot for this utility. This will help us to facilitate the reporting so much.

                    Thanks and more power.

                    Comment


                    • #11
                      Re: CVT2CMD margin on PDFs

                      find this hunk of code in cvt2PDF and modify the 198 font size..
                      your gonna have to play with it for a while....

                      Code:
                       * Determine font size to use from Characters per inch setting       
                      the font is between the "/F1"   &  "Tf"   
                                                                                              
                      c                   SELECT                                              
                      c                   WHEN      siCPI = 50                                
                      c                   CALLP     WritePDF('/F1 19 Tf')                     
                      c                   WHEN      siCPI = 120                               
                      c                   CALLP     WritePDF('/F1 8 Tf')                      
                      c                   WHEN      siCPI = 150                               
                      c                   CALLP     WritePDF('/F1 7 Tf')                      
                      c                   WHEN      siCPI = 167                               
                      c                   CALLP     WritePDF('/F1 5 Tf')                      
                      c                   WHEN      siCPI = 198                               
                      c                   CALLP     WritePDF('/F1 3 Tf')                      
                      c                   OTHER                                               
                      c                   CALLP     WritePDF('/F1 9 Tf')                      
                      c                   ENDSL
                      Attached Files
                      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


                      • #12
                        Re: CVT2CMD margin on PDFs

                        Thanks a lot Jamie.

                        Code400 really is a great forum.
                        Keep up the good work guys.

                        Comment


                        • #13
                          Re: CVT2CMD margin on PDFs

                          I just want to share what i have found out while exploring on this tool.

                          I have resolved the problem with my reports with lengths more than 132 chars long and the right portion got cut off.
                          I have also found another way to put some margin on the left part of the report.

                          here is my changes:

                          PHP Code:

                          orig
                          WritePDF
                          ('/MediaBox ^0 0 792 612]')

                          mods
                          WritePDF
                          ('/MediaBox ^-20 0 892 612]'
                          I have changed the first parameter 0 with a negative value (-20 or whatever your requirements) to increase the left margin.
                          I have changed the third parameter 792 with a bigger value (892 or whatever your requirements) to increase the length of the pdf to fit the length of the report.

                          Hope this helps.

                          Greg

                          Comment


                          • #14
                            Re: CVT2CMD margin on PDFs

                            Thanks greg.............Have a great weekend!
                            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


                            • #15
                              Adobe shows 11.00x8.50 in instead of 8.50x11.00?

                              I downloaded CVT2CMD and works great only issue is that report prints in landscape. Whereas ISERIES prints in portrait mode.

                              What could be the cause?

                              I have a OVRPRTF for 80 column width and 66 in length.

                              Thanks.

                              Comment

                              Working...
                              X