Resolved Command to Write into a PDF Template

chrisds

New Member
Guys,

Need some help here. I'm wondering is there a way to write contents into a PDF template.

Situation :

I have a PDF template with only the Company Logo and Header on top 5 lines of the PDF. Since Progress outputs mainly character based , i was thinking of writing the statements into the template with the Logo and Header.

OS :

Redhat Enterprise Linux 6.6

Currently, i use the OUTPUT command to output to a file, then use enscript command to make the font look better and lastly use ps2pdf command to convert to pdf. This works well, until now some documents require LOGO and Header.

This is my coding :

pdffile = "enscript -B --margins=10:10: -o /home/mfg/email/stmt/emailstmt.ps -f Courier8.5" + " /home/mfg/email/stmt/" + CAPS(STRING(cm_addr)) + "_" + yr + mth + ".txt".
pdfconv = "ps2pdfwr /home/mfg/email/stmt/emailstmt.ps /home/mfg/email/stmt/" + CAPS(STRING(cm_addr)) + "_" + yr + mth + ".pdf".
emailaddr = cm_user2.
mailfile = "mail -s " + """" + "Statement for Customer: " + CAPS(STRING(cm_addr)) + " as of " + STRING(effdate1, "99/99/99") + """" + " -r noreply@sun.com.my " + " -a " + "/home/mfg/email/stmt/" + CAPS(STRING(cm_addr)) + "_" + yr + mth + ".pdf" + " -c account@sunrisepaper.com.my " + TRIM(emailaddr) + " < /home/mfg/email/stmt/stmtbody.txt".

UNIX VALUE(pdffile).
UNIX VALUE(pdfconv).
UNIX VALUE(mailfile).

Anyone have a good solution to output to a file or pdf with LOGO and Headers ?

Thanks all.
 

TomBascom

Curmudgeon
You could also use COPY-LOB to read the file into a MEMPTR, twiddle raw bytes within the MEMPTR, and then write it back out with COPY-LOB again. (Back in the day I used to do fun things with PCL templates. Thankfully those days are over and there are much better ways to get a logo onto a report.) Really, PDF Include is going to be a whole lot easier to work with and give you a ton of future flexibility.
 

chrisds

New Member
Guys, after some research. i found a much easier way to do this. easier than pdfinclude. All you need is pdftk.

Basically :

1. Create a template with Logo, header, footer in Winword and save is as PDF - header.pdf.
2. Then using Progress to output to a file and use enscript and ps2pdfwr to convert to a neatly report - report.pdf.
3. Use pdftk to merge header.pdf and report.pdf

Viola !!! you get a neat PDF report with Header, Logo, or even signature.
 
Top