Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Lieutenant
Lieutenant
360 views

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.....................😩

0 Likes
12 Replies
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

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

 

<>>>

 

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Windows, Linux, or both?


Tom Morrison
Consultant

0 Likes
Lieutenant
Lieutenant

Windows 10  😓..................

0 Likes
Lieutenant
Lieutenant

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............

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

I chose the "Windows Print to PDF" to run the pdraw.cbl sample program. It worked.

Tom Morrison
Consultant

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

Yes. In my case I use pdf995

Regards,

 

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
Lieutenant
Lieutenant

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...............

0 Likes
Knowledge Partner Knowledge Partner
Knowledge Partner

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,

 

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
Lieutenant
Lieutenant

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

0 Likes

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

0 Likes
Lieutenant
Lieutenant

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 !!!!!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.