Date:  10/07/2008 12:25:22 AM Msg ID:  003816
From:  jc clerc Thread:  003813
Subject:  Re: How to fwPDF.SendPDF into a new window ?
If I understand well I can't do that (simply) since the created report requires many open tables, variables and access rights, I can't simply forward to a new web page that will create the PDF.
Is there a way to add in the foxweb engine to simply add a tag .T.or .F. that will allow to choose if you want to open the report in a new page (knowing popup needs to be allowed) ?
My main issue is to delete the PDF once it has been dowloaded in order to cancel all access to that file,  maybe you may have another idea to get that done. Today I save the file into a specific directory wish is not open thru the web so I have to delete the files every day and sometime I erase while the user just created the file !
Kind regards
Sent by FoxWeb Support on 10/06/2008 10:54:09 AM:
Your code will not work, because the JavaScript method expects a URL as its first argument, but instead, you are feeding it the return value from the SendPDF method. Why don't you target the link that calls the PDF-generating script to a new window? This is a lot simpler than using JavaScript:
<a href="MyCreatePdf.fwx?RepForm=xxx" target="PdfWindow">
You can then create a script MyCreatePdf.fwx, which will create and return the actual PDF file.
FoxWeb Support Team email
Sent by jc clerc on 10/06/2008 02:49:14 AM:
I would like to use the FwPDF request since it does delete the file after upload wish is a very good solution but I need to open in a new window since the users are always making the choice to close the window in order to go back to the application !
I have tried that but it doesn't work
M.TempFile = fwPDF.GetTempFile()

<SCRIPT LANGUAGE="javascript">'<%fwPDF.SendPDF(M.TempFile, , .T., fwPDF.PS2PDFMethod <> 0, .T.)%>','print','toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=1, copyhistory=0, menuBar=1, width=600, height=500, left=0, top=0');
Kind regards