I'm following the example "Using an External PDF Page (2)" in the PowerPoint doc.
I've solved some run-time problems. but now the page it creates is blank except for the information I sent to it. It's my understanding it should have created an invoice based on samples\support\invoice.pdf.
Any suggestions/directions are much appreciated.
The resulting PDF is attached.
Here's the code I used:
{PDFinclude/pdf_inc.i "THIS-PROCEDURE"}
DEFINE VARIABLE i_Counter AS INTEGER NO-UNDO.
&scop PDFIdir d:\WDS\CCI\PDFinclude
RUN pdf_new ("Spdf","{&PDFIdir}\samples\super\openpdf.pdf").
RUN pdf_set_parameter("Spdf","Compress","TRUE").
RUN pdf_open_PDF("Spdf","D:\WDS\CCI\PDFinclude\samples\support\Invoice.pdf","Inv").
RUN DoNewPage.
RUN DoInvoiceInfo.
RUN pdf_close("Spdf").
apply "close" to this-procedure.
/* ------------------- INTERNAL PROCEDURES ------------------------- */
PROCEDURE DoNewPage:
RUN pdf_new_page("Spdf").
END.
PROCEDURE DoInvoiceInfo:
DEF BUFFER invoice FOR invoice.
RUN pdf_set_font("Spdf","Helvetica",8).
RUN pdf_text_color("Spdf",1.0,0.0,0.0).
FIND FIRST invoice
NO-LOCK.
/* This procedure overlays the DB info on the external PDF form */
RUN pdf_text_xy ("Spdf",STRING(Invoice.inv-num,"x(12)"),350,557).
RUN pdf_text_xy ("Spdf",STRING(Invoice.inv-date,"99.99.9999"),350,546).
RUN pdf_text_xy ("Spdf",STRING(Invoice.cust-num,"99999"),350,535).
END.
Attachment | Size |
---|---|
openpdf.pdf | 3.16 KB |
pdf_use_PDF_page
you have to use
RUN pdf_use_PDF_page("Spdf", "Inv", 1).
below pdf_open_PDF (or maybe better in donewpage)
to use the first page of the pdf template...