This is a migrated thread and some comments may be shown as answers.

Telerik PDF viewer with silverlight

18 Answers 451 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nikhil
Top achievements
Rank 1
Nikhil asked on 07 Jan 2012, 08:40 AM
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

18 Answers, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 10 Jan 2012, 01:58 PM
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 >>

0
Ashish
Top achievements
Rank 1
answered on 13 Jan 2012, 09:30 PM
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
0
Nikhil
Top achievements
Rank 1
answered on 16 Jan 2012, 01:18 PM
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



0
Iva Toteva
Telerik team
answered on 17 Jan 2012, 06:11 PM
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 >>

0
john
Top achievements
Rank 1
answered on 23 Jan 2012, 07:37 PM
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.
0
Kammen
Telerik team
answered on 25 Jan 2012, 02:52 PM

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 >>

0
Robert
Top achievements
Rank 1
answered on 15 Mar 2012, 11:24 AM
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
0
Kammen
Telerik team
answered on 16 Mar 2012, 06:34 PM
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 >>
0
danparker276
Top achievements
Rank 2
answered on 13 Apr 2012, 08:17 PM
Is there anything on the issue tracker about TIFF support so I can see when it's available or vote on it?
0
Kammen
Telerik team
answered on 17 Apr 2012, 04:16 PM
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 >>

0
Elena
Top achievements
Rank 1
answered on 25 Feb 2013, 02:53 PM
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
0
Kammen
Telerik team
answered on 28 Feb 2013, 09:39 AM
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.

0
Qiping
Top achievements
Rank 1
answered on 23 Sep 2013, 07:07 PM
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
0
Vasil
Telerik team
answered on 24 Sep 2013, 10:33 AM
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.

0
Qiping
Top achievements
Rank 1
answered on 27 Sep 2013, 08:18 PM
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
0
Qiping
Top achievements
Rank 1
answered on 28 Sep 2013, 01:24 AM
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
0
Petya
Telerik team
answered on 02 Oct 2013, 03:29 PM
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 >>
0
Arron
Top achievements
Rank 1
answered on 06 Nov 2013, 04:13 AM
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
Tags
General Discussions
Asked by
Nikhil
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Ashish
Top achievements
Rank 1
Nikhil
Top achievements
Rank 1
Iva Toteva
Telerik team
john
Top achievements
Rank 1
Robert
Top achievements
Rank 1
danparker276
Top achievements
Rank 2
Elena
Top achievements
Rank 1
Qiping
Top achievements
Rank 1
Vasil
Telerik team
Petya
Telerik team
Arron
Top achievements
Rank 1
Share this question
or