locked
PDF Integration possible? RRS feed

  • Question

  • Hi Everyone

    This is my first post, so please bear with me.

    I have a small project that I am working on that I need to add a pdf to the display. Now to display the pdf is not a big problem, but I need two other things. I need the pdf to be displayed when it is a Web Application and not a normal desktop application and the other thing is I need to be able to select text from the pdf, copy that text and then paste somewhere else. The pdf will either be in a sql database or located on a server somewhere.

    My question is this, is there a way of doing this directly in lightswitch or do I need to have a custom control? Can I create such a control in Silverlight and then add it?

    Any advice/suggestions would be greatly appreciated.
    Friday, March 15, 2013 11:50 AM

Answers

  • "Seeing as there is no custom control that does the job properly, will it be possible to create a control in Silverlight and then add this to my project?"

    Yes, as this is the actual definition of creating a custom control, by either taking an existing Silverlight control, or writing a new one. Whichever way you decide then end up with a Silverlight control, it then gets added to a screen as a custom control.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Proposed as answer by Angie Xu Monday, March 25, 2013 1:17 AM
    • Marked as answer by Angie Xu Friday, March 29, 2013 7:20 AM
    Monday, March 18, 2013 1:45 PM
    Moderator
  • What you need is a Silverlight PDF Viewer control that you can encapsulate as a LightSwitch custom control.

    Have a look at ComponentSource's catalog to see if any of these might be suitable.

    Component Source: pdf silverlight


    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.


    • Edited by Yann DuranModerator Wednesday, March 20, 2013 11:42 AM fixed link text
    • Proposed as answer by Angie Xu Monday, March 25, 2013 1:17 AM
    • Marked as answer by Angie Xu Friday, March 29, 2013 7:20 AM
    Wednesday, March 20, 2013 11:03 AM

All replies

  • I am not familiar with LS enough to make a statement of whether this is possible without third party tools, but I know the popular Component One Suite maybe offers something to solve your problem: View PDF Documents Inside Your LightSwitch Applications

    You can download a trial version , so i would just go ahead and see if it works for your scenario.

    I have not used Component One yet, so i can't say if it's worth the money.


    Friday, March 15, 2013 2:37 PM
  • I need the pdf to be displayed when it is a Web Application and not a normal desktop application...

    Hello

    You are really asking two questions in one thread. The answer to question 1 above should be the following bit of code

    if(!System.Windows.Application.Current.IsRunningOutOfBrowser){

    //Show your Pdf

    }

    As you can see it is checking to see if it is running out of browser.

    I dont 100% understand the second question so i will stop there :)


    If you found this post helpful, please mark it as helpful. If by some chance I answered the question, please mark the question as answered. That way you will help more people like me :)

    Friday, March 15, 2013 3:28 PM
  • I have tried their suite, but unfortunately it does not work for what I need to do.

    I can display the pdf, or well some of them at least, but I cannot select text from the pdf to be able to copy it and paste in another control.

    Saturday, March 16, 2013 1:08 PM
  • Sorry for the unclear question. What I am referring to is this, I am building a web base lightswitch application, so there is no need to test for out of browser.

    What I want to do is have my text boxes, grids and so forth on the left hand side of the page while on the right hand side I can display a pdf so that I can select text from the pdf, copy it and then paste into the relevant control.

    Hope this makes more sense.

    Saturday, March 16, 2013 1:11 PM
  • Yes, you'll need a custom control, or a control extension, but there doesn't seem to be one that everyone feels does the job, apparently.

    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Proposed as answer by babloo1436 Monday, March 18, 2013 3:11 AM
    Saturday, March 16, 2013 2:50 PM
    Moderator
  • Seeing as there is no custom control that does the job properly, will it be possible to create a control in Silverlight and then add this to my project?

    Let me know if I need to ask this question in another forum as I do not know if I am allowed to ask Silverlight questions here.

    Or is there some way of converting the pdf into another format, displaying it and then copying the text from the new format?
    Monday, March 18, 2013 6:55 AM
  • hi!

    just curios, when you say that you cannot select text in pdf, you mean about selecting text or right-click context menu?

    Kivito


    Nobody expects the Spanish Inquisition! (M.P.F.C.)

    Monday, March 18, 2013 7:47 AM
  • hi!

    just curios, when you say that you cannot select text in pdf, you mean about selecting text or right-click context menu?

    Kivito


    Nobody expects the Spanish Inquisition! (M.P.F.C.)

    Exactly, I need to be able to right click and copy that text to a text box.
    Monday, March 18, 2013 8:00 AM
  • well if you try to select text ctrl+c / ctrl+v works, but you will need a shell with context menu (like spursoft shell), or maybe you can try to build one yourself (i succeeded to implement it on my test shell, but i'm not sure if it can be created on screen level or at runtime)..

    Kivito


    Nobody expects the Spanish Inquisition! (M.P.F.C.)

    Monday, March 18, 2013 8:06 AM
  • "Seeing as there is no custom control that does the job properly, will it be possible to create a control in Silverlight and then add this to my project?"

    Yes, as this is the actual definition of creating a custom control, by either taking an existing Silverlight control, or writing a new one. Whichever way you decide then end up with a Silverlight control, it then gets added to a screen as a custom control.


    Yann - LightSwitch Central - Click here for FREE Themes, Controls, Types and Commands
     
    Please click "Mark as Answer" if a reply answers your question. Please click "Vote as Helpful" , if you find a reply helpful.
     
    By doing this you'll help others to find answers faster.

    • Proposed as answer by Angie Xu Monday, March 25, 2013 1:17 AM
    • Marked as answer by Angie Xu Friday, March 29, 2013 7:20 AM
    Monday, March 18, 2013 1:45 PM
    Moderator
  • What you need is a Silverlight PDF Viewer control that you can encapsulate as a LightSwitch custom control.

    Have a look at ComponentSource's catalog to see if any of these might be suitable.

    Component Source: pdf silverlight


    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.


    • Edited by Yann DuranModerator Wednesday, March 20, 2013 11:42 AM fixed link text
    • Proposed as answer by Angie Xu Monday, March 25, 2013 1:17 AM
    • Marked as answer by Angie Xu Friday, March 29, 2013 7:20 AM
    Wednesday, March 20, 2013 11:03 AM