Telerik PDF viewer with silverlight

19 posts, 0 answers
  1. Nikhil
    Nikhil avatar
    9 posts
    Member since:
    Oct 2011

    Posted 07 Jan 2012 Link to this post

    Hi Telerik Team,

    Please provide me sample code for pdf telerik viewer because i didnt get the output,i am getting the error of

    RAD COMBOBOX not found




    Thanks

  2. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 10 Jan 2012 Link to this post

    Hi Nikhil,

    The error you are getting sounds like you do not have reference to Telerik.Windows.Controls.Input.dll. Please, try to add this reference and let us know if you are still experiencing the issue. 

    Sample source code you can find in our online demo here.

    If you have further questions do not hesitate to contact us.


    Kind regards,
    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Ashish
    Ashish avatar
    1 posts
    Member since:
    Feb 2011

    Posted 13 Jan 2012 Link to this post

    Hi,

    I downloaded the Q32011 release (trial version) and am trying out the new RadPdfViewer. Firstly my xaml file just kept on getting crashed unless I had to comment the PdfViewer out. After that I tried adding it through code behind and it didn't error out, but the pdfViewer didn't display my pdf. Just a blank screen. I have attached a screen shot and sample code. Any help would be appreciated.

    Code:
    Try
                Dim pdfViewer As RadPdfViewer
                pdfViewer = New RadPdfViewer With {.DocumentSource = New PdfDocumentSource(New System.Uri("/TestingTelerikNewRelease;component/Assets/Resources/How_Would_You_Move_Mount_Fuji.pdf", UriKind.Relative))}
                LayoutRoot.Children.Add(pdfViewer)
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub


    Thanks
  5. Nikhil
    Nikhil avatar
    9 posts
    Member since:
    Oct 2011

    Posted 16 Jan 2012 Link to this post

    Hi Telerik

    We are also facing the same problem, when we are passing the path to document source of pdfviewer in silverlight,
    it will throw an error , the file does not exist.Can you give me some helpful suggestion


    Thanks
    Nikhil



  6. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 17 Jan 2012 Link to this post

    Hi Rocky, Nikhil,

    Actually the reason for the behavior you are observing is probably different.

    @Rocky
    It is possible that the PDF file you are trying to open cannot be opened due to its contents. You can try opening the file in our online demo, which uses 2011 Q3 SP1 (2011.3.1220). If the file is not shown, then this theory will be verified. In that case, we would appreciate it if you could open a support ticket and attach the file. We would be able to shed some more light on the unsupported part of the content, as well as a time frame of when the content will be supported.

    @ Nikhil
    In your case, the problem is that the file cannot be located. Please, check if the file is added as a resource in the project and that the path is correct. More information on this can be found in this article.

    All the best,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. john
    john avatar
    1 posts
    Member since:
    Aug 2010

    Posted 23 Jan 2012 Link to this post

    PDF Viewer

    1st. I am using PDF Sharp to convert Tiffs to PDF.

    The generated files open fine in Acrobat Reader.

    I then switched to memory stream (Instead of writing file out) and set it to the source for the PDF viewer. Page number is correct but each page is blank.

    I thought there might be an issue with MS so I saved file opened file in viewer directly. Same issue.

    issue also exists on your sample page with SL viewer.

    Your acceptable extensions do not allow for me to attach a pdf sample.
  8. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 25 Jan 2012 Link to this post

    Hello John,

    Currently, images in tiff format are not supported by RadPdfViewer. However, we will do our best to implement a tiff filter for the Q1 release.

    When it comes to attaching files, only images can be attached to forum posts. In that regard, we would appreciate it if you could open a support ticket and send us a sample file to further investigate the problem.

    Regards,
    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  9. Robert
    Robert avatar
    10 posts
    Member since:
    Oct 2011

    Posted 15 Mar 2012 Link to this post

    Hi,

    Im my development xaml design view, the pdf is showing the preview, but on a debug mode, it is showing only black screen.
    Am I missing something .
    Thanks in advance.

    Robert
  10. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 16 Mar 2012 Link to this post

    Hi Robert,

    This may be caused by wrong DocumentSource. For example, if you have a PDF document in your application, and you set the DocumentSource = "document.pdf" in XAML, it will show in design mode, but not at runtime.
    The URI should be DocumentSource = "[YourApplication];component/document.pdf".

    Regards,
    Kammen
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  11. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 13 Apr 2012 Link to this post

    Is there anything on the issue tracker about TIFF support so I can see when it's available or vote on it?
  12. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 17 Apr 2012 Link to this post

    Hi Dan,

    RadPdfViewer partially supports CCITTFaxDecode (that is basically TIFF). There are some limitations that are not supported at this stage like EncodedByteAlign = true or Group 3, 2-D encoding. At this point, implementing finer support for TIFF images is not on our roadmap, but I have created a PITS issue which you can vote for and use to track our plans:

    You can follow the PITS Issue by its ID: 10758
    Here you can find the PITS Issue: Public URL 

    On the other hand, there is a way to implement your own encoder and to register it in RadPdfViewer. You can download the source of the controls to see how the other decoders have been implemented. We have provided API for plugging custom decoders which the PdfViewer will use instead of the default ones.

    Kind regards,
    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  13. Elena
    Elena avatar
    8 posts
    Member since:
    Jun 2011

    Posted 25 Feb 2013 Link to this post

    Hi,
    We have a telerik pdf viewer in  XAML and load pdf file from stream
    PDFview.pdfViewer.DocumentSource = New
    PdfDocumentSource(New MemoryStream(_docData.Data))
    but some pdf files e.g.TelerikReporting-LearningGuide.pdf are displayed incorrect (wrong encoding, strange signs or is not displayed att all without error message)
    Would be very grateful for any hint.

    Best regards
    Elena
  14. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 28 Feb 2013 Link to this post

    Hi Elena,

    The issue should be solved in the latest version (Q1 2013).

    Greetings,
    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  15. Qiping
    Qiping avatar
    4 posts
    Member since:
    Jul 2013

    Posted 23 Sep 2013 Link to this post

    Hello, Kammen,

    I have the same problem to display the pdf file at run time. It can show on the design viewer but not at run time. My application is named "RadControlsSilverlightPdf" and the pdf file was saved at "../pdf/test.pdf". If I set the URI as DocumentSource="pdf/test.pdf", it can display the pdf file in the design viewer, but not at the run time. Followed your suggestion to set the URI to
                    DocumentSource="[RadControlsSilverlightPdf]; component/pdf/test.pdf"
    It even did not show in the design viewer.

    Please see the screenshot image.

    Thanks

    Sheng
  16. Vasil
    Admin
    Vasil avatar
    124 posts

    Posted 24 Sep 2013 Link to this post

    Hi Qiping,

    As Kamen explained in a previous post, to show a PDF document both in design mode and runtime, the DocumentSource URI should be in the following format: "[YourApplication];component/document.pdf"  where the brackets aim to indicate the application name and are not included in the actual URI.

    With regard to your application it will look like this: DocumentSource="RadControlsSilverlightPdf;component/pdf/test.pdf".

    I hope this solves your problem. Please, let us know if you need any other assistance.

    Greetings,
    Vasil
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  17. Qiping
    Qiping avatar
    4 posts
    Member since:
    Jul 2013

    Posted 27 Sep 2013 Link to this post

    Hey, Telerik,

    Great this have solved my problem. My new question is: "Could you please provide a sample code in C# for run time setting the URI? Since I want to load different pdf file based on the user request."

    Thanks

    Qiping
  18. Qiping
    Qiping avatar
    4 posts
    Member since:
    Jul 2013

    Posted 27 Sep 2013 Link to this post

    Hey Telerik,

    1. The code on your demo side http://demos.telerik.com/silverlight/#Touch/PdfViewer/FirstLook. looks really cool. I have copied the sample code to my project. But I noticed that I need the dll
         xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=QuickStart.Common"

    How can I get this? Do you have this in the trial version? I did not see it in my trial version. I think without this the code could not recognize
        Visibility="{Binding OpenCommandDescriptor.IsEnabled, Converter={StaticResource BoolToVisibilityConverter}}" in the xaml file.

    2. Also When I try to load the pdf file by setting the URI in C# code.

    this.pdfViewer.DocumentSource = newPdfDocumentSource(newSystem.Uri("DocumentSource;component/Sample.pdf", System.UriKind.Relative));

    It will complain the the namespace of PdfDocumentSource could not be found. Which reference I need to add? I do have
    FixedDocumentViewers.dll and Documents.Fixed.dll included in my reference. But why it still not working? Please see the attached image.

    Thanks

    Qiping
  19. Petya
    Admin
    Petya avatar
    975 posts

    Posted 02 Oct 2013 Link to this post

    Hello Qiping,

    Other than our online examples, you should take a look at the SDK repository as well. It is developer-oriented and you can download and run the projects locally. 

    That said, the assembly and respectively - namespace you are referring to are implemented for the purposes of the application holding the online examples. It is not shipped with the controls and not needed in order to use RadPdfViewer. All needed assemblies are listed in this help article.

    As for the issue at hand, the Telerik.Windows.Documents.Fixed namespace is missing from your code. Adding it should resolve the problem and everything should run smoothly.
    using Telerik.Windows.Documents.Fixed;

    I hope this helps!

    Regards,
    Petya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  20. Arron
    Arron avatar
    22 posts
    Member since:
    Apr 2013

    Posted 05 Nov 2013 Link to this post

    using System.IO;
    using System.Drawing.Printing;
    using Yiigo.Imaging;
    using Yiigo.Imaging.Processing;
    using Yiigo.Imaging.Conversion;

    using YiigoImage Image = new YiigoImage();
    // Convert TIFF to PDF documents
    public void ConversionTIFFtoPdf();
    {
    string TIFFFileName = (@"C:\ yiigo_example.tif");
    ImageFormat ImageFormat = ImageFormat.pdf;
    }
    public Image ConversionPdftoTIFF(@"C:\ yiigo_example.tif", ImageFormat.pdf);
    doc.Save(@"C:\ yiigo_example.pdf");

    // Convert PDF documents to TIFF
    public Image ConversionPdftoTIFF();
    {
    string PdfFileName = (@"C:\ yiigo_example.pdf");
    int PdfPageNumber = "1";
    ImageFormat ImageFormat = ImageFormat.tif;
    }
    public void ConversionTIFFtoPdf(@"C:\ yiigo_example.pdf", "1", ImageFormat.tif);
    doc.Save(@"C:\ yiigo_example.tif");
    I am testing the code above to convert PDF document into TIFF image format with Windows Viewer and create PDF viewer with the help of another tool. I hope it helps. I will try Telerik later.



    Best regards,
    Arron
Back to Top
DevCraft banner