rairch
New Member
Progress v9.1D
PDFInclude v3.3.3
Hi All,
I'm being driven up the wall by a problem with pdf generation. I have a WebSpeed app which creates an expenses claim. The Finance department require that I can print a nice form out from it after the claim has been submitted so that receipts can be attached and posted to them & want hte form to look as much as possible like the orignal excel spreadsheet they currently use (so that rules html out)
Hence I have used adobe distiller to create a 3 page pdf document from the original spreadsheet & have spent many an enjoyable hour mapping form fields onto it.
I have then written print functionality using PDFInclude & Streamfile in order to output it to a javascript opened window from my print button (never having used PDFInclude or Streamfile until last thursday this has also been fun.....)
In my program I use the standard functionality to create the new pdf & find the template as follows:
/* Set Export path & filename */
lcfilename = "PDF/" + ttExpnExpenseHeader.claimref + ".pdf".
/* create new pdf document */
RUN pdf_new ("expnpdf", lcfilename).
/* open expenses pdf template */
RUN pdf_open_PDF("expnpdf","expn/pdf_templates/HomeExp.pdf",ttExpnExpenseHeader.claimref).
/* set standard font for output to pdf */
RUN pdf_set_font("expnpdf", "Helvetica", "8").
Then I create the first page & output lots of pdf_fill_text to map to the form fields on my template:
/* create first page */
RUN pdf_new_page("expnpdf").
RUN pdf_use_PDF_page("expnpdf",ttExpnExpenseHeader.claimref,1).
<pdf_fill_text>
/* create second page */
RUN pdf_new_page("expnpdf").
RUN pdf_use_PDF_page("expnpdf",ttExpnExpenseHeader.claimref,2).
This works fine for the first & second pages of the pdf. However the third page is in landscape format & it doesn't display properly.
Having fiddled about with it for a the last day I have discovered the following:
1. Using pdf_new_page("expnpdf") - page generates as landscape but field mapping is incorrect (seems to be trying to map to portrait)
2. Using pdf_new_page2("expnpdf","landscape") - page generates as portrait?!? but with chopped off landscape layout + field mapping still incorrect
3. Using pdf_new_page2 ("expnpdf","portrait") - page generates same as using pdf_new_page...
4. Using pdf_set_orientation("expnpdf","landscape").
pdf_new_page2("expnpdf","landscape"). -page generates as landscape but field mapping is incorrect (seems to be trying to map to portrait)
5. Using pdf_set_orientation("expnpdf","landscape").
pdf_new_page2("expnpdf","portrait"). - page generates as landscape but field mapping is incorrect (seems to be trying to map to portrait)
I've tried pretty much every combination I can think off & nothing seems to work. As the fields don't map correctly I wonder if it could be anythign to do with the pdf template. I distilled the two portrait pages seperately fro mthe landscape them merged the two pdf's as they were on seperate worksheets in the excel.
Anyone have any ideas as this is driving me crazy?
Cheers,
Simon.
PDFInclude v3.3.3
Hi All,
I'm being driven up the wall by a problem with pdf generation. I have a WebSpeed app which creates an expenses claim. The Finance department require that I can print a nice form out from it after the claim has been submitted so that receipts can be attached and posted to them & want hte form to look as much as possible like the orignal excel spreadsheet they currently use (so that rules html out)
Hence I have used adobe distiller to create a 3 page pdf document from the original spreadsheet & have spent many an enjoyable hour mapping form fields onto it.
I have then written print functionality using PDFInclude & Streamfile in order to output it to a javascript opened window from my print button (never having used PDFInclude or Streamfile until last thursday this has also been fun.....)
In my program I use the standard functionality to create the new pdf & find the template as follows:
/* Set Export path & filename */
lcfilename = "PDF/" + ttExpnExpenseHeader.claimref + ".pdf".
/* create new pdf document */
RUN pdf_new ("expnpdf", lcfilename).
/* open expenses pdf template */
RUN pdf_open_PDF("expnpdf","expn/pdf_templates/HomeExp.pdf",ttExpnExpenseHeader.claimref).
/* set standard font for output to pdf */
RUN pdf_set_font("expnpdf", "Helvetica", "8").
Then I create the first page & output lots of pdf_fill_text to map to the form fields on my template:
/* create first page */
RUN pdf_new_page("expnpdf").
RUN pdf_use_PDF_page("expnpdf",ttExpnExpenseHeader.claimref,1).
<pdf_fill_text>
/* create second page */
RUN pdf_new_page("expnpdf").
RUN pdf_use_PDF_page("expnpdf",ttExpnExpenseHeader.claimref,2).
This works fine for the first & second pages of the pdf. However the third page is in landscape format & it doesn't display properly.
Having fiddled about with it for a the last day I have discovered the following:
1. Using pdf_new_page("expnpdf") - page generates as landscape but field mapping is incorrect (seems to be trying to map to portrait)
2. Using pdf_new_page2("expnpdf","landscape") - page generates as portrait?!? but with chopped off landscape layout + field mapping still incorrect
3. Using pdf_new_page2 ("expnpdf","portrait") - page generates same as using pdf_new_page...
4. Using pdf_set_orientation("expnpdf","landscape").
pdf_new_page2("expnpdf","landscape"). -page generates as landscape but field mapping is incorrect (seems to be trying to map to portrait)
5. Using pdf_set_orientation("expnpdf","landscape").
pdf_new_page2("expnpdf","portrait"). - page generates as landscape but field mapping is incorrect (seems to be trying to map to portrait)
I've tried pretty much every combination I can think off & nothing seems to work. As the fields don't map correctly I wonder if it could be anythign to do with the pdf template. I distilled the two portrait pages seperately fro mthe landscape them merged the two pdf's as they were on seperate worksheets in the excel.
Anyone have any ideas as this is driving me crazy?
Cheers,
Simon.