Auto-download pdf

I tried searching for a similar question but I could not.
I want to create a PDF and save it to a specific location on the server, every time a user submits a form.
But using the export-to-PDF functionality it asks the user where we wish to save the PDF file.
IS it possible in any way to predefine the location of the file where it is to be saved and prevent the prompting?

you may customize file gridPdfWrapper.php to change saving behavior.
The follow line is resposible to output pdf to browser.

$this->cb->Output('grid.pdf', 'I');

Here is a documentation of this function so you may change destination yourself: … ee2f5b23a1

Hi Radyno,
I am sorry I did not mention that I am using the java package, not the PHP package.
I made some changes and the pdf is auto saving, but it opens up a new tab/window everytime it saves the PDF.
Is there any way to silently save it?

You may try to use grid.toExcel instead of grid.toPDF on client side. They are the same, but export to PDF opens new page to show generated PDF-file.

Thank you for the reply.
I use the standard version of dhtmlx. When I use export to excel, I get a new window too. :confused:

please, try to update file ext/dhtmlxgrid_export.js from attachment. (2.96 KB)

Export to excel still opens a new page.
can it be because I am testing on IE6 :frowning:

hi nana111,
I am using java not c#
But thank you for the suggestion. :slight_smile:

Sorry for the delay in answerring.
I tried to export it on a local computer, but it doesn’t create new tab. Could you provide complete demo to run it on a local machine? Or maybe link to you grid?

I tried the code with toExcel function in Chrome.
It worked without a new tab. must have been due to Internet Explorer.
Thanks for your help. :slight_smile: