PDF Include table program ?

NewB

New Member
PDFInclude table program ?

Hello,

Open Edge 10.1C
PdfInclude 3.3.3

I need to create PDF files with OpenEdge and after searching the web,
I found the program PdfInclude and I'm trying it.

I tested the example table.p but I have a problem with the cell border.

In the PDF exemple cell border look good, but when i'm trying on my server they look thick.

I commented out the section that defines the appearance of the table, but i have the same problem.

Thanks for your help

here the code and pdf file is attached.

Code:
DEFINE VARIABLE h_PDFtable AS HANDLE NO-UNDO.
DEFINE VARIABLE h_TT AS HANDLE NO-UNDO.
DEFINE TEMP-TABLE TT_mydata NO-UNDO RCODE-INFORMATION
FIELD Custno AS CHAR format "x(20)"
FIELD CustName AS CHAR format "x(20)"
FIELD PhoneNo AS CHAR format "x(20)"
FIELD State AS CHAR format "x(20)".
 
/* Build my Temp Table Data */
DEF VAR i AS INT.
 
DO i = 1 TO 100: 
 
CREATE TT_mydata.
ASSIGN TT_mydata.CustNo = "CustNo " + string(i)
TT_mydata.CustName = "Name " + string(i)
TT_mydata.PhoneNo = "Phone " + string(i)
TT_mydata.State = "State " + string(i).
END.
 
{ pdf_inc.i }
RUN pdf_new("Spdf","table.pdf").
RUN pdf_set_parameter("Spdf","Compress","TRUE"). 
 
/* Set Page Header procedure */
pdf_PageHeader ("Spdf",
THIS-PROCEDURE:HANDLE,
"PageHeader").
 
/* Set Page Header procedure */
pdf_PageFooter ("Spdf",
THIS-PROCEDURE:HANDLE,
"PageFooter").
 
/* Don't want the table to be going until the end of the page or too near the 
side */
RUN pdf_set_LeftMargin("Spdf",20).
RUN pdf_set_BottomMargin("Spdf",50).
 
/* Link the Temp-Table to the PDF */
h_TT = TEMP-TABLE TT_mydata:HANDLE.
RUN pdf_tool_add ("Spdf","CustList", "TABLE", h_TT).
 
/* Now Setup some Parameters for the Table */
/* comment out this section to see what the default Table looks like */
/*
RUN pdf_set_tool_parameter("Spdf","CustList","Outline",0,".5").
RUN pdf_set_tool_parameter("Spdf","CustList","HeaderFont",0,"Helvetica-Bold").
RUN pdf_set_tool_parameter("Spdf","CustList","HeaderFontSize",0,"8").
RUN pdf_set_tool_parameter("Spdf","CustList","HeaderBGColor",0,"255,0,0").
RUN pdf_set_tool_parameter("Spdf","CustList","HeaderTextColor",0,"255,255,255").
RUN pdf_set_tool_parameter("Spdf","CustList","DetailBGColor",0,"200,200,200").
RUN pdf_set_tool_parameter("Spdf","CustList","DetailTextColor",0,"0,0,200").
RUN pdf_set_tool_parameter("Spdf","CustList","DetailFont",0,"Helvetica").
RUN pdf_set_tool_parameter("Spdf","CustList","DetailFontSize",0,"8").
*/
/* end of section */
 
/* Define Table Column Headers */
RUN pdf_set_tool_parameter("Spdf","CustList","ColumnHeader",1,"Customer #").
RUN pdf_set_tool_parameter("Spdf","CustList","ColumnHeader",2,"Name").
RUN pdf_set_tool_parameter("Spdf","CustList","ColumnHeader",3,"Phone #").
RUN pdf_set_tool_parameter("Spdf","CustList","ColumnHeader",4,"State").
/* Define Table Column Widths */
RUN pdf_set_tool_parameter("Spdf","CustList","ColumnWidth",1,"20").
RUN pdf_set_tool_parameter("Spdf","CustList","ColumnWidth",2,"30").
RUN pdf_set_tool_parameter("Spdf","CustList","ColumnWidth",3,"15").
RUN pdf_set_tool_parameter("Spdf","CustList","ColumnWidth",4,"10").
 
/* Now produce the table */
RUN pdf_tool_create ("Spdf","CustList").
RUN pdf_close("Spdf").
 
/* ------------------------ INTERNAL PROCEDURES ---------------------------- */
PROCEDURE PageHeader:
/*------------------------------------------------------------------------------
Purpose: Procedure to Print Page Header -- on all pages.
------------------------------------------------------------------------------*/
/* Set Header Font Size and Colour */
RUN pdf_set_font ("Spdf","Courier-Bold",14.0). 
RUN pdf_text_color ("Spdf",1.0,.0,.0).
/* Output Report Header */
RUN pdf_text_xy ("Spdf","Customer List",pdf_LeftMargin("Spdf"),pdf_PageHeight("Spdf") - 25).
RUN pdf_text_color ("Spdf",.0,.0,.0).
RUN pdf_set_font ("Spdf","Courier",10.0). 
END. /* PageHeader */
PROCEDURE PageFooter:
/*------------------------------------------------------------------------------
Purpose: Procedure to Print Page Footer -- on all pages.
------------------------------------------------------------------------------*/
/* Set Footer Font Size and Colour */
RUN pdf_set_font ("Spdf","Courier-Bold",10.0). 
RUN pdf_text_color ("Spdf",0.0,.0,.0).
 
RUN pdf_skip ("Spdf").
RUN pdf_set_dash ("Spdf",1,0).
RUN pdf_line ("Spdf", pdf_LeftMargin("Spdf"), pdf_TextY("Spdf") - 5, pdf_PageWidth("Spdf") - 20 , pdf_TextY("Spdf") - 5, 1).
RUN pdf_skip ("Spdf").
RUN pdf_skip ("Spdf").
RUN pdf_text_to ("Spdf", "Page: " 
+ STRING(pdf_page("Spdf"))
+ " of " + pdf_TotalPages("Spdf"), 110).
 
END. /* PageFooter */
 

Attachments

  • table.pdf
    7.1 KB · Views: 31

GregTomkins

Active Member
Can't help with the question, just curious:

Does everyone out here in ProgressLand generate PDF? We have always generated PS and then used GhostScript to convert PS to PDF. I can't see a super-compelling reason to do it one way or the other, other than, one step is probably better than two.
 

LarryD

Active Member
We've been using PDFInclude for some time now and I find that it meets our needs quite well. Since all of our customers are using *nix servers, when we need to print we use the pdf2ps which comes with Ghostscript.

I did however write our own custom parameter-driven front-end to it that allows us to use configuration files to do all the fancy stuff. We just do normal printing using text output within the code, then run the custom program where it merges the text with the configuration to create the pdf. It allowed us to minimally impact the legacy code and still generate pdf's with graphics, barcodes, boxes, etc.
 

NewB

New Member
hello,

I am looking for the easiest way to generate PDF files with the Progress.

Actually i generate XML files with Progress and then i use FPDF lib
with php to produce PDF. With this lib i make complex report.
But this solution is too complex for making basic reports (automatic board, page number not more)

I have see that PdfInclude can generate automatic table but i have a problem (cf. my first post)

How do you generate PS ? can you show me a basic exemple ?

VpxPrint is working on linux ? i have only see a .dll lib not .so
 
Top