Announcement

Collapse
No announcement yet.

How open a PDF file clicking on a Form Button ??

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How open a PDF file clicking on a Form Button ??

    Hello all,

    I got to open an external file (like help file) clicking on a button "HELP" on a form .
    Which is best and easy solution ??
    Many thanks

  • #2
    sc_redir("full_or_relative_url_to_your_pdf_file",' ','_blank');
    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

    Comment


    • #3
      GREAT !!! Tomorrow morning I'll try.
      As directory is better to use and save the pdf file under SC default doc folder
      So when I call it from my application need I to use ../../_lib/file/doc/name_of_file.pdf ...


      I lways make confusion between these folders... why img are in two places ? Is the _lib/img only for applications images... ? and /public_html/eosb2b/_lib/file/img for the images stored during the use of the project ? Is only that the difference ?

      /public_html/eosb2b/_lib/file/img
      /public_html/eosb2b/_lib/img/

      For doc I think is better to use this one /public_html/eosb2b/_lib/file/doc

      Comment


      • #4
        Hello Giu,
        a did this test.
        I put the file under localhost: C:\Program Files (x86)\Scriptcase\v8_new\wwwroot\scriptcase\file\do c\eos_sales_doc\COND_GEN_FORNITURA_LUGLIO15.pdf

        I need that once deployed the sc_redir works properly. I think I have to use relative path


        sc_redir("..\..\..\_lib\file\doc\eos_sales_doc\CON D_GEN_FORNITURA_LUGLIO15.pdf",' ','_blank');

        It seems to try to open the file (I suppose...) but this is the error

        Forbidden

        You don't have permission to access /scriptcase/app/B2B_B2C/......_lib iledocos_sales_docCOND_GEN_FORNITURA_LUGLIO15.pdf/......_lib iledocos_sales_docCOND_GEN_FORNITURA_LUGLIO15.pdf .php on this server.




        if I use instead

        sc_redir("../../../_lib/file/doc/eos_sales_doc/COND_GEN_FORNITURA_LUGLIO15.pdf",' ','_blank');

        The error is

        Not Found

        The requested URL /scriptcase/_lib/file/doc/eos_sales_doc/COND_GEN_FORNITURA_LUGLIO15.pdf was not found on this server.

        Comment


        • #5
          It's a classic !!! When you go to mechanic the car always do not show the problems you got till one minute before !!!! ;-)
          The following works !!!

          sc_redir('../../../file/doc/eos_sales_doc/COND_GEN_FORNITURA_LUGLIO15.pdf','_blank');

          This open the doc _lib has to be jumped.... (don't know why) .

          When I'll run it on production server I need to have a different page becouse otherwise I can't close the pdf only. Is _blank the right choice ??

          Comment


          • #6
            _blank is to open in another page, but buttons has too a target property, defining where should be executed.

            Before, didn't worked because URL in PHP is with / not \. Between " (double quote), in PHP \ is an escape character. For example, \n is new line
            On dev ../_lib doesn't exists because prod enviroment is not inside project code.
            /Giuseppe

            Professional Scriptcase Services
            Some Customers opinions

            Comment

            Working...
            X