ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Customizing pdf name and directory

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

  • Customizing pdf name and directory

    I have a printer that print a pdf correctly, but the filename and the ubication is in default mode.
    How I can rename dinamicaly the filename and specify the directory (not the base directory)?
    Sorry for my english!

  • #2
    Re: Customizing pdf name and directory

    Need to do a mapping program only to change the destination directory?
    In wich language? CL is posible?

    Comment


    • #3
      Re: Customizing pdf name and directory

      Which version of OS are you running?
      What are you printing the PDF with?

      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


      • #4
        Re: Customizing pdf name and directory

        Originally posted by jamief View Post
        Which version of OS are you running?
        What are you printing the PDF with?

        jamie
        Hi Jamie, the version of my OS is 6
        I'm printing the pdf with PSF TCP/IP IPDS printer, with this command:
        Code:
        CRTDEVPRT DEVD(PRINTER) DEVCLS(*LAN) TYPE(*IPDS) MODEL(0) LANATTACH(*IP) AFP(*YES) PORT(19920) FONT(011) RMTLOCNAME(?127.0.0.1?) USRDFNOBJ(MYLIB/MYPSFCFG *PSFCFG)
        The printer generate a pdf file name like this:
        Code:
        103036_000013_QPDCDVV_07172002_000001.PDF
        And put the file into directory like this:
        Code:
        /folder-name/job-name/job-number/job-user-name/file-number/spooled-file-name/date/sequence-number/
        The main folder name I specify in the PSFCFG.

        I need to fix the output folder and the same name for all documents.
        I'm reading an Infoprint server User guide but cannot do this. http://publib.boulder.ibm.com/infoce...r/g5445775.pdf

        Comment


        • #5
          Re: Customizing pdf name and directory

          This may help:
          Steps to Convert a Spooled File to PDF|
          1. |In iSeries Navigator, expand My Connections (or your active |environment).
          2. |Expand Basic Operations and select Printer |Output.
          3. |Right-click the output file you want to convert and select Convert to |PDF... . To select more than one file, |CTRL+click each file. The Convert Printer Output to PDF |dialog opens with the specified printer output files in the Printer |output list.
          4. |Select Send as electronic mail, Save in Integrated File |System, or Save to output queue along with any other values |you want, such as a PDF mapping program.
          5. |Specify the device to use to convert the printer output file. You |can specify library-qualified output queue, the printer to send the output |file to, or both.
          6. |Click OK. |
          |A new printer output file is created for each printer output file you |selected. When the file is processed, the new output files are removed |from the output queue. For help with any field, select the field and |press F1. |Note: |Do not change the User data field on the input spooled file. |



          By the way .... To create the pdf I generally use ovrdbf in cl:

          Code:
             CHGVAR     VAR(&DIRENTRY) VALUE('/usrfls/out/' *CAT &username) <-----directory to save pdf
                   MD         DIR(&direntry) DTAAUT(*RWX) +                 
                                      OBJAUT(*ALL)                          
                      monmsg cpf0000                                        
             chgvar     var(&direntry) value(&direntry *Tcat '/'  *Tcat +   
                            &pdfname)     <-----pdf file name I've assigned                                  
                  OVRPRTF FILE(*PRTF) DEVTYPE(*AFPDS) CTLCHAR(*FCFC) +      
                    tostmf(&direntry) wscst(*pdf)
          Best of Luck
          GLS
          The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

          Comment


          • #6
            Re: Customizing pdf name and directory

            The last time I played with anything like this, I created a OUTQ and attached a exit program to it. It was quite a while ago, I believe that it was v5r4. The exit program took a series of parms and data from a file and produced an email with an attachment in .pdf format that you could pretty much name whatever you wanted.

            I've got the source for the program (the source for the files is long since gone), your more than welcome to it if that sounds like something you'd like to try.

            Comment


            • #7
              Re: Customizing pdf name and directory

              I only change the destination folder and the name of pdf.
              Other option is obtain the name of generated file and the destination folder, but I have not enough knowledge.
              Regards.

              Comment


              • #8
                Re: Customizing pdf name and directory

                did you even try the OVRPRTF command GLS posted above???
                I'm not anti-social, I just don't like people -Tommy Holden

                Comment


                • #9
                  Re: Customizing pdf name and directory

                  Originally posted by GLS400 View Post
                  This may help:

                  Code:
                  CHGVAR  VAR(&DIRENTRY) VALUE('/usrfls/out/' *CAT &username) <-----directory to save pdf
                  MD         DIR(&direntry) DTAAUT(*RWX) +                 
                                     OBJAUT(*ALL)                          
                         monmsg cpf0000                                        
                  chgvar     var(&direntry) value(&direntry *Tcat '/'  *Tcat +   
                                &pdfname)     <-----pdf file name I've assigned                                  
                          OVRPRTF FILE(*PRTF) DEVTYPE(*AFPDS) CTLCHAR(*FCFC) +      
                            tostmf(&direntry) wscst(*pdf)
                  Use this code, and create a screen and request &pdfname, get &username from the job... pretty simple.


                  Originally posted by pepitovadecurt View Post
                  I only change the destination folder and the name of pdf.
                  Other option is obtain the name of generated file and the destination folder, but I have not enough knowledge.
                  Regards.
                  There's tons of knowledge on these boards if you just take the time to really look at what the guys say when they post it. I've learned a ton from these guys, GLS, tomholden and everyone else that's a regular here.
                  Last edited by ARobb73; January 26, 2012, 07:49 AM. Reason: cleaning up the quoted code a bit...

                  Comment


                  • #10
                    Re: Customizing pdf name and directory

                    I've been trying and cannot obtaing good results, the printer finalize with errors.
                    This CL changes all documents of this printer? The printer must be AFPDS (now is IPDS config).
                    When I must to call these CL?

                    Comment


                    • #11
                      Re: Customizing pdf name and directory

                      Hi pepitovadecurt:

                      Can you post the CL you have so far?

                      GLS
                      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                      Comment


                      • #12
                        Re: Customizing pdf name and directory

                        And the errors, the more info we have the easier it will be to help you.

                        Comment


                        • #13
                          Re: Customizing pdf name and directory

                          Hi pepitovadecurt:
                          After re-reading this post I think the point of confusion is What exactly you are trying to change.

                          Correct me if I'm wrong but you seem to be using INFOPRINT SERVER to generate the pdf. The solution that I proposed is to modify the single program that you want a pdf from .... not all printouts that go to a specific printer.

                          The single program method:
                          Code:
                          .... OLD CL pgm                                
                          dcl &text *CHAR 25             
                          CLRPFM AC             
                          {DO MORE CL STUFF}            
                           CALL MYPGM
                          ENDPGM
                          
                          ....NEW REPLACEMENT 
                          CL pgm                                
                          dcl &text *CHAR 25             
                          CLRPFM AC             
                          {DO MORE CL STUFF}       
                          OVRPRTF FILE(QSYSPRT) DEVTYPE(*AFPDS) CTLCHAR(*FCFC) +                
                          tostmf('/mydir/mysubdir/mypdf.pdf') wscst(*pdf)            
                           CALL MYPGM
                          ENDPGM
                          If you want to use infoprint then yes you will need to do pdf mapping (something I've never done before) but you can find (i think) a step by step here:http://www-912.ibm.com/s_dir/SLKBase...b?OpenDocument
                          Best of Luck
                          GLS
                          Attached Files
                          Last edited by GLS400; January 27, 2012, 11:32 AM.
                          The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                          Comment


                          • #14
                            Re: Customizing pdf name and directory

                            Sorry for my inattention, but few problems with the stocks and government inspection
                            Next days i'll be return...
                            Specilly thanks to GLS400.

                            Comment

                            Working...
                            X