[Gambas-user] Example for download and print in gb.web/gb.web.form

Safiur Rahman isafiur at gmail.com
Wed Apr 29 18:08:01 CEST 2020


Hi

Passing path of created file does not work:
''Generating PDF
sPath = Temp() & ".pdf
Shell "wkhtmltopdf " & sHtml & " " & sPath Wait

 ''Printing PDF (generated above)
  Me.Exec("printJS('" & sPath & "')")

How can I get web root and how can I send file there? I have to run
application with apache2 from /usr/lib/cgi-bin/ folder.

On 4/29/20, Safiur Rahman <isafiur at gmail.com> wrote:
> Hi
> I included printJS  (https://printjs.crabbly.com/) and I could print
> properly any content. I also created PDF using external application
> (eg. wkhtmltopdf). But during printing the PDF (generated from
> wkhtmltopdf) I couldn't pass the correct path of the file to printJS
> because the PDF file was generated in Temp folder. How can I pass file
> path in Temp folder to javascript function? I have been using
> gb.web.gui.
>
> ''Generating PDF
> sPath = Temp() & ".pdf
> Shell "wkhtmltopdf " & sHtml & " " & sPath Wait
>
> ''Printing PDF
>  Me.Exec("printJS('" & "test.pdf" & "')")
>
> On 4/18/20, Safiur Rahman <isafiur at gmail.com> wrote:
>> Thank you very much
>> Can you provide an example of forcing a file to download. I couldn't do
>> it.
>>
>> On 4/17/20, Safiur Rahman <isafiur at gmail.com> wrote:
>>> Hi
>>> Can you please provide an example in gb.web/gb.web.form so that I can
>>> convert a HTML file into PDF and download it or send to printer.
>>>
>>
>>
>> --
>> Regards
>> Safiur Rahman
>>
>
>
> --
> Regards
> Safiur Rahman
>


-- 
Regards
Safiur Rahman


More information about the User mailing list