Results 1 to 13 of 13
  1. #1
    Join Date
    Jul 2011
    Posts
    176

    Lightbulb Unanswered: Showing Pdf file in HTML field

    Hi Brillinat users
    Is there any way we can preview pdf file in HTML field.The pdf file could be either from database or in the computer.

    Regards
    Asokram

  2. #2
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Should be possible.
    Try this.
    http://stackoverflow.com/questions/4...in-web-browser

    Regards
    James.

  3. #3
    Join Date
    Jul 2011
    Posts
    176
    Quote Originally Posted by Tubbritt View Post
    Should be possible.
    Try this.
    http://stackoverflow.com/questions/4...in-web-browser

    Regards
    James.
    Thank you James.
    I tried all codings. Nothing works.
    My requirement is preview the pdf file stored in the file field of the database. Or preview the file path mentioned in the URL field of the databse.Sample database attached.

    pdf.zip

  4. #4
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi asokram.

    I've only quickly looked at this but if you put the following into your HTML field.
    Code:
    <object width="99%" height="99%" data="path to file"></object> [/url]
    Change path to file, to where ever your file is located. This works for me.

    Regards
    James.

  5. #5
    Join Date
    Oct 2013
    Posts
    55
    Provided Answers: 2
    James
    This example when I try it wants a type tag
    Joe

  6. #6
    Join Date
    Oct 2013
    Posts
    55
    Provided Answers: 2
    This works for me now

    <body>
    <object data="[$_myfiles]\PenMaking\[PDF_Name]" type="application/pdf" width="99%" height="99%" >
    </object>
    </body>

    replace my data link to match where your files are located at
    Joe

  7. #7
    Join Date
    Jul 2011
    Posts
    176
    Quote Originally Posted by Tubbritt View Post
    Hi asokram.

    I've only quickly looked at this but if you put the following into your HTML field.
    Code:
    <object width="99%" height="99%" data="path to file"></object> [/url]
    Change path to file, to where ever your file is located. This works for me.

    Regards
    James.
    Thank you james.
    Unfortunately It is not working for me.
    I am using windows 8. Both Internet explorer and chrome browser.I have installed Adobe acrobat too. While opening pdf file in internet explorer the pdf file is opening in browser without any problem. I am surprised why it is not displaying in the database.Tried to change the default browser settings and the results still same.I do not know what settings I need to change.
    Any help? can you send me your working sample file please!

    Thanks and Regards
    Asokram

  8. #8
    Join Date
    Jul 2011
    Posts
    176
    Quote Originally Posted by joeatact View Post
    This works for me now

    <body>
    <object data="[$_myfiles]\PenMaking\[PDF_Name]" type="application/pdf" width="99%" height="99%" >
    </object>
    </body>

    replace my data link to match where your files are located at
    Joe
    Thank you Joe. Unfortunately this code do not work for me.

    Thanks and Regards
    Asokram

  9. #9
    Join Date
    Oct 2013
    Posts
    55
    Provided Answers: 2
    Forgot to mention it will use your defaulf pdf viewer like foxit etc

  10. #10
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi Asokram

    Far as I know (but I'm not 100% of this), Brilliant Database uses the default browser add-ons that are installed in your current version of Internet Explorer. So if your using some other browser as your default, you will still need the Acrobat reader add-ons installed in Internet Explorer.

    So for me the code works without any problem.

    That being said, it's not ideal I guess to depend on the end users PC to have Adobe installed, so it might be worth looking at compiling a third party open source viewer into the myfiles folder to render the PDF files. At least this way the program will work regards of Adobe being installed or not.

    I must try this myself to see of I can do it that way. If I get something working, I'll upload it.

    Regards
    James.

  11. #11
    Join Date
    Jul 2011
    Posts
    176
    Quote Originally Posted by Tubbritt View Post
    I must try this myself to see of I can do it that way. If I get something working, I'll upload it.

    Regards
    James.
    Idea is good.Thank you James. Let me also try.

  12. #12
    Join Date
    Jun 2012
    Posts
    163
    Provided Answers: 1
    two ideas:

    1. put your pdf in an iframe ( try this for example: <iframe id="iframepdf" src="files/example.pdf"></iframe>)
    this will create a frame inside your html field, if the format dont like you iframe has properties, you can search for them.

    2. you said you would like to show a pdf stored in your database, i can be done with a litle trick, hope it likes you:

    1) create a folder inside myfiles folder in your proyect app folder (myfile.app folder for example) you can name this folder as "pdf"

    2) create a html field with this code: <iframe id="iframepdf" src="/myfiles/exported.pdf"></iframe>) i think that you have to change "/myfiles/" for "[_Myfiles] or something like that so brilliant puts the system variable myfiles (you can see the help document about myfiles system variable)

    3)create a code that make this, it can be stored into a button called "refresh" the code should do this:
    a) if it exists...delete a file called exported.pdf
    b) export the pdf file you want to see from your database (i guess you stored it as an attachement) to the folder your created in step 1 "myfiles/pdfs" folder with a name, maybe "exported.pdf" (to match with the name you put inside your html code, inside your html field)

    i hope i made myself clear, let me know i did not or if it worked for you.

    best regards.

    fer from mexico

  13. #13
    Join Date
    Jul 2011
    Posts
    176
    Quote Originally Posted by ferslash View Post
    two ideas:

    1. put your pdf in an iframe ( try this for example: <iframe id="iframepdf" src="files/example.pdf"></iframe>)
    this will create a frame inside your html field, if the format dont like you iframe has properties, you can search for them.

    2.
    1) create a folder inside myfiles folder in your proyect app folder (myfile.app folder for example) you can name this folder as "pdf"

    2) create a html field with this code: <iframe id="iframepdf" src="/myfiles/exported.pdf"></iframe>) i think that you have to change "/myfiles/" for "[_Myfiles] or something like that so brilliant puts the system variable myfiles (you can see the help document about myfiles system variable)

    3)create a code that make this, it can be stored into a button called "refresh" the code should do this:
    a) if it exists...delete a file called exported.pdf
    b) export the pdf file you want to see from your database (i guess you stored it as an attachement) to the folder your created in step 1 "myfiles/pdfs" folder with a name, maybe "exported.pdf" (to match with the name you put inside your html code, inside your html field)

    i hope i made myself clear, let me know i did not or if it worked for you.

    best regards.

    fer from mexico
    Dear Ferslash, Thanks for the suggestions.
    Unfortunately it is not working in my case.

    Regards
    Asokram.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •