locked
Display a PDF from Lightswitch RRS feed

  • Question

  • I have a Lightswitch application that I need to add the ability to display a PDF.

    I am looking at an extension called Document Viewer which appears to have everything I need but unless I'm mistaken it can only display PDFs in the DocumentViewer Control that are stored in a database as variable binary data.

    My question is... how do I store a PDF in a SQL database as variable binary data so that Document Viewer can display it?  What must I do to get the PDFs into SQL?  Write a separate Lightswitch program?  Do it in SQL?  Wave my magic wand?  I'm lost.

    What if I abandon the concept of displaying the PDF directly in Lightswitch but instead simply provide a clickable link on a Lightswitch screen that contains the path to the PDF and just let Windows open the PDF using the default program assigned to .PDF (Adobe Reader)?  Would that work?  I understrand that it would create additional overhead while Adobe opened but would it work?  Can I add a clickable link to a Lightswitch screen... similar to the way you can add a Button... and on click the PDF opens in Adobe reader?  

    Thanks

    Ed

     

    Thursday, May 1, 2014 4:26 PM

Answers

  • ComponentOne make a PDF Viewer control that works with LightSwitch but using Shell Execute to call Adobe Reader works fine if you have a path to the document.


    Simon Jones
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to "Mark as Answer". This will help other people find answers to their problems more quickly.

    • Marked as answer by Angie Xu Tuesday, May 13, 2014 2:09 AM
    Tuesday, May 6, 2014 8:47 AM

All replies

  • Hi Ed,

    If I remember correctly the document viewer control (from FirstFloor) manages the upload of documents to the database.

    Have you seen this post http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/3255/LightSwitch-html5-SPA-ndash-Document-Manager-App.aspx

    It shows how to upload documents including pdf's to the database in a LightSwitch html application and how to download them again.

    Hope that helps.

    Thanks

    Delordson

    http://www.lightswitchextras.com/

    Thursday, May 1, 2014 8:10 PM
  • ComponentOne make a PDF Viewer control that works with LightSwitch but using Shell Execute to call Adobe Reader works fine if you have a path to the document.


    Simon Jones
    If you found this post helpful, please "Vote as Helpful". If it actually answered your question, please remember to "Mark as Answer". This will help other people find answers to their problems more quickly.

    • Marked as answer by Angie Xu Tuesday, May 13, 2014 2:09 AM
    Tuesday, May 6, 2014 8:47 AM