Skip to main content

generate a file pdf

  • Mar 12, 2021 10:56 PM UTC
  • 12 replies
  • 30 views

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
Forum|alt.badge.img+2

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
Forum|alt.badge.img
  • 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?


  • 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
Forum|alt.badge.img
  • 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.

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


  • Mar 31, 2021 1:39 PM UTC

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

Many thanks for the suggestion. But now I have another dubt.  My program generates the file pdf and it's ok.  I will have to create a program that prints a bill in pdf and send it by e-mail ( I have the destination address in my archive cobol with the other information of the customer ). How can I print and sent it ???  ( many times the pdf to send are more than one ....... )   These last two nights I worked hard but I had no results....................

Many thanks to all you !!!!!


Juan Urraburu
  • Participating Frequently
  • Apr 5, 2021 11:20 PM UTC

Many thanks for the suggestion. But now I have another dubt.  My program generates the file pdf and it's ok.  I will have to create a program that prints a bill in pdf and send it by e-mail ( I have the destination address in my archive cobol with the other information of the customer ). How can I print and sent it ???  ( many times the pdf to send are more than one ....... )   These last two nights I worked hard but I had no results....................

Many thanks to all you !!!!!

Hi,

I assume you can generate the PDF file and also send it by email, buy you want to automate the PDF generation without entering a file name each time you run, rihgt?

Please take a look for Microsoft Print to PDF. The same type of configuration will work for other king of PDF printers like pdf995

https://docs.microsoft.com/es-ES/troubleshoot/windows-server/printing/print-to-file-without-user-intervention

Regards,