Skip to main content
Mar 12, 2021 10:56 PM UTC

generate a file pdf

Hi,  in RM/COBOL 12xx is possible generate a file pdf ?  I'll explain : I've a program that print on a printer a bill. If I need to trasform or redirect the printout created  on a file .pdf how can do it ?

 Thanks everyone for the help.....................

    12 replies

    Dominique Sacre
    Rocketeer
    Mar 12, 2021 11:46 PM UTC

    Hi,  in RM/COBOL 12xx is possible generate a file pdf ?  I'll explain : I've a program that print on a printer a bill. If I need to trasform or redirect the printout created  on a file .pdf how can do it ?

     Thanks everyone for the help.....................

    Hi

    Have you looked at "pandoc"

    This is very powerful and can create pdf files.

    see

    https://pandoc.org/demos.html

    scroll down and see pdf examples.

    <>>

     

    • From markdown to PDF:

      pandoc MANUAL.txt --pdf-engine=xelatex -o example13.pdf
    • PDF with numbered sections and a custom LaTeX header:

      pandoc -N --template=template.tex --variable mainfont="Palatino" --variable sansfont="Helvetica" --variable monofont="Menlo" --variable fontsize=12pt --variable version=2.0 MANUAL.txt --pdf-engine=xelatex --toc -o example14.pdf

     

    <>>>

     

    Thomas Morrison
    Participating Frequently
    Mar 12, 2021 11:49 PM UTC

    Hi,  in RM/COBOL 12xx is possible generate a file pdf ?  I'll explain : I've a program that print on a printer a bill. If I need to trasform or redirect the printout created  on a file .pdf how can do it ?

     Thanks everyone for the help.....................

    Windows, Linux, or both?

    Tom Morrison, Consultant, South Carolina, USA
    Mar 14, 2021 4:40 PM UTC

    Windows, Linux, or both?

    Windows 10  ..................

    Mar 14, 2021 5:01 PM UTC

    Hi

    Have you looked at "pandoc"

    This is very powerful and can create pdf files.

    see

    https://pandoc.org/demos.html

    scroll down and see pdf examples.

    <>>

     

    • From markdown to PDF:

      pandoc MANUAL.txt --pdf-engine=xelatex -o example13.pdf
    • PDF with numbered sections and a custom LaTeX header:

      pandoc -N --template=template.tex --variable mainfont="Palatino" --variable sansfont="Helvetica" --variable monofont="Menlo" --variable fontsize=12pt --variable version=2.0 MANUAL.txt --pdf-engine=xelatex --toc -o example14.pdf

     

    <>>>

     

    Hi, I tried to use pandoc in demo but I hope I don't' understand the use. The question is: If I open my and print as in the example below, how can print with PANDOC ????

    Excuse me but I'm a little inexperienced.................   many thanks

    SELECT STAMPA ASSIGN TO PRINT MODULO
    FILE STATUS IS STAMPA-STATUS.

    ..................................

    FD STAMPA LABEL RECORD OMITTED.
    01 STREC PIC X(232).

    ...............................

    77 MODULO PIC X(9) VALUE "PRINTER?".

    ..........................

    OPEN OUTPUT STAMPA.

    ................


    call "P$DrawBitmap" using "LOGODIT.bmp"
    , 00,0 00,5 "A" "M" 06,3 02,1 "M".

    etc............

    Thomas Morrison
    Participating Frequently
    Mar 15, 2021 6:36 PM UTC

    Windows 10  ..................

    I chose the "Windows Print to PDF" to run the pdraw.cbl sample program. It worked.
    Tom Morrison, Consultant, South Carolina, USA
    Juan Urraburu
    Participating Frequently
    Mar 16, 2021 12:03 AM UTC
    I chose the "Windows Print to PDF" to run the pdraw.cbl sample program. It worked.

    Yes. In my case I use pdf995

    Regards,

     

    Mar 16, 2021 5:22 PM UTC
    I chose the "Windows Print to PDF" to run the pdraw.cbl sample program. It worked.

    Thank you very much for the help. I tried the utility and works fine but I have another big doubt. Once I generate the pdf file, how can I send the generated file via e-mail ? I have the address in my cobol database but I don't know the way to do this. Expect I too much ???   thanks for your patience...............

    Juan Urraburu
    Participating Frequently
    Mar 16, 2021 6:30 PM UTC

    Thank you very much for the help. I tried the utility and works fine but I have another big doubt. Once I generate the pdf file, how can I send the generated file via e-mail ? I have the address in my cobol database but I don't know the way to do this. Expect I too much ???   thanks for your patience...............

    Hi,

    You can use Mailsend (mailsend.exe) via a call "system" like this:

    MOVE "youremail@gmail.com" TO MAIL-OFLONDON
    MOVE "yourpassword" TO LAPASSWORD
    move spaces to reg1.
    move 512 to largo
    move spaces to lineaemail.
    move "email that sends" to li-mail.
    String 'C:\\windows\\system32\\cmd /c MailSend -f '
    DELIMITED BY SIZE
    MAIL-OFLONDON delimited by " "
    ' -starttls -d -auth-login' delimited by size
    ' -port 587' delimited by size
    ' -smtp smtp.gmail.com -t '
    delimited by size
    LI-mail delimited by " "
    ' -user ' DELIMITED BY SIZE
    MAIL-oflondon DELIMITED BY " "
    ' -pass ' DELIMITED BY SIZE
    lapassword delimited by " "
    ' -sub "Subject for your email"'
    delimited by size
    ' -attach "body.txt,text/plain,i"'
    delimited by size
    ' -attach "attachment.pdf"'
    delimited by size
    into reg1
    end-string.
    MOVE 0 TO LARGO.
    INSPECT reg1 TALLYING LARGO FOR
    CHARACTERS BEFORE INITIAL " ".
    move reg1 to lineaemail.

    Call "System" using lineaemail.

    You can download Mailsend here: https://github.com/muquit/mailsend/releases/tag/1.19

    Regards,

     

    Mar 17, 2021 5:41 PM UTC

    Hi,

    You can use Mailsend (mailsend.exe) via a call "system" like this:

    MOVE "youremail@gmail.com" TO MAIL-OFLONDON
    MOVE "yourpassword" TO LAPASSWORD
    move spaces to reg1.
    move 512 to largo
    move spaces to lineaemail.
    move "email that sends" to li-mail.
    String 'C:\\windows\\system32\\cmd /c MailSend -f '
    DELIMITED BY SIZE
    MAIL-OFLONDON delimited by " "
    ' -starttls -d -auth-login' delimited by size
    ' -port 587' delimited by size
    ' -smtp smtp.gmail.com -t '
    delimited by size
    LI-mail delimited by " "
    ' -user ' DELIMITED BY SIZE
    MAIL-oflondon DELIMITED BY " "
    ' -pass ' DELIMITED BY SIZE
    lapassword delimited by " "
    ' -sub "Subject for your email"'
    delimited by size
    ' -attach "body.txt,text/plain,i"'
    delimited by size
    ' -attach "attachment.pdf"'
    delimited by size
    into reg1
    end-string.
    MOVE 0 TO LARGO.
    INSPECT reg1 TALLYING LARGO FOR
    CHARACTERS BEFORE INITIAL " ".
    move reg1 to lineaemail.

    Call "System" using lineaemail.

    You can download Mailsend here: https://github.com/muquit/mailsend/releases/tag/1.19

    Regards,

     

    A great idea !    I'll try and I'll let you know.............. I hope to succeed

    Mar 31, 2021 8:51 AM UTC

    Hi,  in RM/COBOL 12xx is possible generate a file pdf ?  I'll explain : I've a program that print on a printer a bill. If I need to trasform or redirect the printout created  on a file .pdf how can do it ?

     Thanks everyone for the help.....................

    Hello. My experience is using a PDF printer. With a PDF printer you can use the "PRINTER?" and you just have to select the PDF printer and the file name. I recommend Bullzip PDF is free. https://www.bullzip.com/products/pdf/download.php