rupert1962
New Member
Progress 9.1D, PDFInclude 3.3.3
Hi,
I have just downloaded and installed pdf include and have a question.
I have createda simple .p to create and populate a pdf with some purchase order line info. If i use one of the blank pdf's included in the download (POForm63.pdf) as a template i can create and populate a new pdf no problem. Substituting my template for POForm63.pdf in the RUN pdf_open_PDF statement gives the following errors:
<temp-dir>\PO-16-0.txt was not found.
<temp-dir>\PO-22-0.txt was not found.
<temp-dir>\PO-15-0.txt was not found.
<temp-dir>\PO-17-0.txt was not found.
All my template has in it is a logo and some address data. I'm at a bit of a loss to understand what is going wrong. My template was created in word and converted to pdf. Could this be the cause?
All help greatfully received.
(code below)
{ pdf_inc.i "THIS-PROCEDURE"}
DEFINE VARIABLE i_LineCounter AS INTEGER NO-UNDO.
DEFINE VARIABLE dec_SubTotal AS DECIMAL NO-UNDO.
RUN pdf_new ("Spdf","FormFill-enc.pdf").
FIND FIRST po_mstr
WHERE po_mstr.po_nbr = 'PO10001':U NO-LOCK.
/* Set the PageHeader Routine */
pdf_PageHeader ("Spdf",
THIS-PROCEDURE:HANDLE,
"PageHeader").
/* Set the PageFooter Routine */
pdf_PageFooter ("Spdf",
THIS-PROCEDURE:HANDLE,
"PageFooter").
RUN pdf_set_parameter("Spdf","Compress","TRUE").
RUN pdf_open_PDF("Spdf","P:\POForm62.pdf","RO").
RUN ProcessPOs.
RUN pdf_close("Spdf").
/* ------------------- INTERNAL PROCEDURES ------------------------- */
PROCEDURE ProcessPOs:
RUN DoNewPage.
ASSIGN i_LineCounter = 0
dec_SubTotal = 0.
RUN skipLines (INPUT 6).
FOR EACH pod_det
WHERE pod_det.pod_nbr = po_mstr.po_nbr NO-LOCK:
i_LineCounter = i_LineCounter + 1.
RUN DoPOLine.
RUN skipLines (INPUT 2).
/* If more than 5 lines then create another page */
IF i_LineCounter > 5 THEN DO:
RUN DoNewPage.
i_LineCounter = 0.
END.
END.
END.
PROCEDURE skipLines:
DEFINE INPUT PARAMETER ipiSkipLines AS INTEGER NO-UNDO.
DEFINE VARIABLE iIdx AS INTEGER NO-UNDO.
DO iIdx = 1 TO ipiSkipLines:
RUN pdf_skip ("Spdf").
END.
END.
PROCEDURE DoNewPage:
RUN pdf_new_page("Spdf").
RUN pdf_use_PDF_page("Spdf","RO",1).
END.
PROCEDURE PageHeader:
DEFINE VARIABLE cStatePost AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSupplier AS CHARACTER NO-UNDO EXTENT 3.
DEFINE VARIABLE cCustomer AS CHARACTER NO-UNDO EXTENT 3.
/* Get Supplier Info */
FIND xad_mstr
WHERE xad_mstr.xad_addr = po_mstr.po_vend
NO-LOCK NO-ERROR.
FIND ad_mstr
WHERE ad_mstr.ad_addr = xad_mstr.xad_addr
NO-LOCK NO-ERROR.
cStatePost = ad_mstr.ad_state + ' ' + xad_mstr.xad_post_code.
ASSIGN
cSupplier[1] = ad_mstr.ad_sort
cSupplier[2] = xad_mstr.xad_street
cSupplier[3] = cStatePost.
/* Get Ship to Info */
FIND xad_mstr
WHERE xad_mstr.xad_addr = po_mstr.po_ship
NO-LOCK NO-ERROR.
FIND ad_mstr
WHERE ad_mstr.ad_addr = xad_mstr.xad_addr
NO-LOCK NO-ERROR.
cStatePost = ad_mstr.ad_state + ' ' + xad_mstr.xad_post_code.
ASSIGN
cCustomer[1] = ad_mstr.ad_sort
cCustomer[2] = xad_mstr.xad_street
cCustomer[3] = cStatePost.
/* message Supplier.Name view-as alert-box. */
/* Display 'To' information */
RUN skipLines (INPUT 14).
RUN pdf_text_at ("Spdf",STRING(po_mstr.po_nbr,"99999"),20).
RUN skipLines (INPUT 4).
RUN pdf_text_at ("Spdf",cSupplier[1],10).
RUN pdf_text_at ("Spdf",cCustomer[1],60).
RUN pdf_skip ("Spdf").
RUN pdf_text_at ("Spdf",cSupplier[2],10).
RUN pdf_text_at ("Spdf",cCustomer[2],60).
RUN pdf_skip ("Spdf").
RUN pdf_text_at ("Spdf",cSupplier[3],10).
RUN pdf_text_at ("Spdf",cCustomer[3],60).
RUN skipLines (INPUT 9).
/* Display 'PO Header' Information */
RUN pdf_text_at ("Spdf",STRING(po_mstr.po_ord_date,"99/99/99"),10).
RUN pdf_text_at ("Spdf","NET 30",80).
END.
PROCEDURE PageFooter:
RUN pdf_skip ("Spdf").
RUN pdf_text_at ("Spdf",STRING(dec_SubTotal,">,>>9.99"),80).
RUN skipLines (INPUT 6).
RUN pdf_text_at ("Spdf",STRING(dec_SubTotal,">,>>9.99"),80).
END.
PROCEDURE DoPOLine:
RUN pdf_text_at ("Spdf",STRING(pod_det.pod_Qty_ord,">,>>9.99"),5).
RUN pdf_text_at ("Spdf",pod_det.pod_part,18).
FIND FIRST pt_mstr WHERE pt_mstr.pt_part = pod_det.pod_part NO-LOCK NO-ERROR.
RUN pdf_text_at ("Spdf",pt_mstr.pt_desc1 + ' ' + pt_mstr.pt_desc2,30).
RUN pdf_text_at ("Spdf",STRING(pod_det.pod_std_cost,">,>>9.99"),72).
RUN pdf_text_at ("Spdf",STRING(pod_det.pod_std_cost * pod_det.pod_qty_ord, ">,>>9.99"),86).
ASSIGN dec_SubTotal = dec_SubTotal
+ pod_det.pod_std_cost * pod_det.pod_qty_ord.
END.
/* end of FormFill.pdf */
Hi,
I have just downloaded and installed pdf include and have a question.
I have createda simple .p to create and populate a pdf with some purchase order line info. If i use one of the blank pdf's included in the download (POForm63.pdf) as a template i can create and populate a new pdf no problem. Substituting my template for POForm63.pdf in the RUN pdf_open_PDF statement gives the following errors:
<temp-dir>\PO-16-0.txt was not found.
<temp-dir>\PO-22-0.txt was not found.
<temp-dir>\PO-15-0.txt was not found.
<temp-dir>\PO-17-0.txt was not found.
All my template has in it is a logo and some address data. I'm at a bit of a loss to understand what is going wrong. My template was created in word and converted to pdf. Could this be the cause?
All help greatfully received.
(code below)
{ pdf_inc.i "THIS-PROCEDURE"}
DEFINE VARIABLE i_LineCounter AS INTEGER NO-UNDO.
DEFINE VARIABLE dec_SubTotal AS DECIMAL NO-UNDO.
RUN pdf_new ("Spdf","FormFill-enc.pdf").
FIND FIRST po_mstr
WHERE po_mstr.po_nbr = 'PO10001':U NO-LOCK.
/* Set the PageHeader Routine */
pdf_PageHeader ("Spdf",
THIS-PROCEDURE:HANDLE,
"PageHeader").
/* Set the PageFooter Routine */
pdf_PageFooter ("Spdf",
THIS-PROCEDURE:HANDLE,
"PageFooter").
RUN pdf_set_parameter("Spdf","Compress","TRUE").
RUN pdf_open_PDF("Spdf","P:\POForm62.pdf","RO").
RUN ProcessPOs.
RUN pdf_close("Spdf").
/* ------------------- INTERNAL PROCEDURES ------------------------- */
PROCEDURE ProcessPOs:
RUN DoNewPage.
ASSIGN i_LineCounter = 0
dec_SubTotal = 0.
RUN skipLines (INPUT 6).
FOR EACH pod_det
WHERE pod_det.pod_nbr = po_mstr.po_nbr NO-LOCK:
i_LineCounter = i_LineCounter + 1.
RUN DoPOLine.
RUN skipLines (INPUT 2).
/* If more than 5 lines then create another page */
IF i_LineCounter > 5 THEN DO:
RUN DoNewPage.
i_LineCounter = 0.
END.
END.
END.
PROCEDURE skipLines:
DEFINE INPUT PARAMETER ipiSkipLines AS INTEGER NO-UNDO.
DEFINE VARIABLE iIdx AS INTEGER NO-UNDO.
DO iIdx = 1 TO ipiSkipLines:
RUN pdf_skip ("Spdf").
END.
END.
PROCEDURE DoNewPage:
RUN pdf_new_page("Spdf").
RUN pdf_use_PDF_page("Spdf","RO",1).
END.
PROCEDURE PageHeader:
DEFINE VARIABLE cStatePost AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSupplier AS CHARACTER NO-UNDO EXTENT 3.
DEFINE VARIABLE cCustomer AS CHARACTER NO-UNDO EXTENT 3.
/* Get Supplier Info */
FIND xad_mstr
WHERE xad_mstr.xad_addr = po_mstr.po_vend
NO-LOCK NO-ERROR.
FIND ad_mstr
WHERE ad_mstr.ad_addr = xad_mstr.xad_addr
NO-LOCK NO-ERROR.
cStatePost = ad_mstr.ad_state + ' ' + xad_mstr.xad_post_code.
ASSIGN
cSupplier[1] = ad_mstr.ad_sort
cSupplier[2] = xad_mstr.xad_street
cSupplier[3] = cStatePost.
/* Get Ship to Info */
FIND xad_mstr
WHERE xad_mstr.xad_addr = po_mstr.po_ship
NO-LOCK NO-ERROR.
FIND ad_mstr
WHERE ad_mstr.ad_addr = xad_mstr.xad_addr
NO-LOCK NO-ERROR.
cStatePost = ad_mstr.ad_state + ' ' + xad_mstr.xad_post_code.
ASSIGN
cCustomer[1] = ad_mstr.ad_sort
cCustomer[2] = xad_mstr.xad_street
cCustomer[3] = cStatePost.
/* message Supplier.Name view-as alert-box. */
/* Display 'To' information */
RUN skipLines (INPUT 14).
RUN pdf_text_at ("Spdf",STRING(po_mstr.po_nbr,"99999"),20).
RUN skipLines (INPUT 4).
RUN pdf_text_at ("Spdf",cSupplier[1],10).
RUN pdf_text_at ("Spdf",cCustomer[1],60).
RUN pdf_skip ("Spdf").
RUN pdf_text_at ("Spdf",cSupplier[2],10).
RUN pdf_text_at ("Spdf",cCustomer[2],60).
RUN pdf_skip ("Spdf").
RUN pdf_text_at ("Spdf",cSupplier[3],10).
RUN pdf_text_at ("Spdf",cCustomer[3],60).
RUN skipLines (INPUT 9).
/* Display 'PO Header' Information */
RUN pdf_text_at ("Spdf",STRING(po_mstr.po_ord_date,"99/99/99"),10).
RUN pdf_text_at ("Spdf","NET 30",80).
END.
PROCEDURE PageFooter:
RUN pdf_skip ("Spdf").
RUN pdf_text_at ("Spdf",STRING(dec_SubTotal,">,>>9.99"),80).
RUN skipLines (INPUT 6).
RUN pdf_text_at ("Spdf",STRING(dec_SubTotal,">,>>9.99"),80).
END.
PROCEDURE DoPOLine:
RUN pdf_text_at ("Spdf",STRING(pod_det.pod_Qty_ord,">,>>9.99"),5).
RUN pdf_text_at ("Spdf",pod_det.pod_part,18).
FIND FIRST pt_mstr WHERE pt_mstr.pt_part = pod_det.pod_part NO-LOCK NO-ERROR.
RUN pdf_text_at ("Spdf",pt_mstr.pt_desc1 + ' ' + pt_mstr.pt_desc2,30).
RUN pdf_text_at ("Spdf",STRING(pod_det.pod_std_cost,">,>>9.99"),72).
RUN pdf_text_at ("Spdf",STRING(pod_det.pod_std_cost * pod_det.pod_qty_ord, ">,>>9.99"),86).
ASSIGN dec_SubTotal = dec_SubTotal
+ pod_det.pod_std_cost * pod_det.pod_qty_ord.
END.
/* end of FormFill.pdf */