Fill Pdf??

Daniel Vanzo

New Member
Hello!
Environment:
Linux
Mfg/Pro 8.6 Character
Progress 9.1E
I have a requirement to fill a pdf template with data from Mfg/Pro. Anybody knows any product that we can use to accomplish this task? I remember an article years ago about a library (fpdf??) and how to use it from Progress 4GL, but I can't found it...

TIA!!
Daniel
 

rstanciu

Member
If the the HTML syntax is known ... the reste ... is very simple:


/* editionPDF.p */
/* Download HTMLDOC: http://www.htmldoc.org/software.php */
DEFINE VARIABLE fileName AS CHARACTER NO-UNDO.
DEFINE STREAM ls.
fileName = "c:\tmp\report.html".
&SCOPED-DEFINE PRINT PUT STREAM ls UNFORMATTED
/************************************/
OUTPUT STREAM ls TO VALUE(fileName).
{&PRINT} "<HTML>" SKIP.
{&PRINT} "<TABLE border=1>" SKIP.
{&PRINT} "<TR>" SKIP.
{&PRINT} "<TH>CustNum</TH><TH>Name</TH><TH>Phone</TH>" SKIP.
{&PRINT} "</TR>" SKIP.
FOR EACH Customer NO-LOCK:
{&PRINT} "<TR>" SKIP.
{&PRINT} "<TD align=right bgColor=yellow>" +
STRING(Customer.CustNum) +
"</TD><TD>" + Customer.Name +
"</TD><TD>" + Customer.Phone +
"</TD>" SKIP.
{&PRINT} "</TR>" SKIP.
END.
{&PRINT} "</TABLE>" SKIP.
{&PRINT} "</HTML>" SKIP.
OUTPUT STREAM ls CLOSE.

OS-COMMAND SILENT(VALUE('"C:\Program Files\HTMLDOC\ghtmldoc.exe" -f c:\tmp\test.pdf ' +
'--webpage c:\tmp\report.html --size a4 ')).
OS-DELETE VALUE("c:\tmp\report.html").

/************************************/
 
Top