We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Pdf Viewer LoadDocument doesn't work

Hi,

I'm trying to display simply a PDF document with SfPdfViewerControl,

but LoadDocument method throws an exception and I don't know why, because I just copied and pasted the example from sample.

Here's my code:

var picker = new FileOpenPicker();
                                    picker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
                                    picker.ViewMode = PickerViewMode.List;
                                    picker.FileTypeFilter.Add(".pdf");
                                    var filetest = await picker.PickSingleFileAsync();
                                    var stream = await filetest.OpenAsync(Windows.Storage.FileAccessMode.Read);
                                    Stream fileStream = stream.AsStreamForRead();
                                    byte[] buffer = new byte[fileStream.Length];
                                    fileStream.Read(buffer, 0, buffer.Length);
                                    PdfLoadedDocument ldoc = new PdfLoadedDocument(buffer);
                                    await pdfViewer.LoadDocumentAsync(ldoc);  // Here is thrown an exception


The thrown exception's message is:

Object reference not set to an instance of an object.


Could somebody help me to find the solution?

Thanks very much.

18 Replies

SM Suresh M Syncfusion Team May 29, 2013 05:39 AM UTC

Hi Oh,

 

Thank you for your interest in Syncfusion products.

 

We are not able to reproduce the issue “Null reference exception is thrown when using LoadDocumentAsync method”. We tried with the sample available in the link below, but threading exception occurs in the Viewer when using LoadDocumentAsync method. We have logged an issue report for fixing this issue, the fix for this issue will be available in our upcoming release.

 

Sample Link: GappTestPdfViewer_LoadAsync.zip

 

Please let us know if you have any concerns.

 

Thanks,

Suresh



SA sandeep June 21, 2013 06:55 AM UTC

Hi,
I also facing same exception in Load Document. please tell me what the solution for this. I purchased license for this control.


Demo App for Pdfviewer_e4e90bea.rar


SM Suresh M Syncfusion Team June 24, 2013 11:18 AM UTC

Hi Sandeep,

Thank you for your interest in Syncfusion products.

We are able to reporduce the issue mentioned using the sample provided. Can you please create a direct-trac incident to follow up the fix for this issue.

Please let us know if you have any concerns.

Thanks,
Suresh


SA sandeep June 25, 2013 01:12 PM UTC

Hi Suresh,
Thanks your reply! I already attached a demo app with my previous post. please find the attachment.
And one more question,
I am creating invoices as word document and excel document, I am not able to display image on these document at run time. Image is different for each invoice in both cases.
I am generating my invoice details for both format using template.


SM Suresh M Syncfusion Team June 27, 2013 11:25 AM UTC

Hi Sandeep,

 

Thank you for your response.

 

We are able to reproduce the issue with the sample provided, the fix for this issue will be available in our refresh release for WinRT and this is expected to be available in the end of this week.

 

Regarding the query about creating the invoice in Word and Excel, please follow the solution for this in the forum

 

http://www.syncfusion.com/support/forums/metrostudio/109644

 

Please let us know if you have any concerns.

 

Thanks,

Suresh



EM Emi July 3, 2013 10:11 AM UTC

Please let me know if this issue is fixed. I have the same problem when load PDF on winRT


SM Suresh M Syncfusion Team July 3, 2013 10:22 AM UTC

Hi Emi

 

The issue LoadDocumentAsync method is fixed in our service pack. We are glad to announce that our Essential Studio Vol 2 service pack 2013 is rolled out and is available for download under the following link.

 

http://www.syncfusion.com/support/forums/winrt/109691/Syncfusion-Essential-Studio-for-WinRT-%28XAML%29-v112029-%28Service-Pack%29-available-for-download-

 

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

 

Regards,

Suresh



EM Emi July 4, 2013 04:12 AM UTC


I'm able to fix this issue. Please reference all assemblies in DirectXAssembly folder. You should copy all file in it then reference Syncfusion.DirectXWrapper.WinRT as well as Syncfusion.SfPdfViewer.WinRT

Thanks for your support.



SM Suresh M Syncfusion Team July 4, 2013 04:49 AM UTC

Hi Emi,

Thank you for your response.

We are glad to hear that your issue is resolved.

Please let us know if you require any further assistance.

Thanks,
Suresh


SA sandeep July 5, 2013 07:46 AM UTC

Hi Suresh,
Thanks for your help. Can you tell me how to upgrade our syncfusion winrt? I already have purchased this.
And again thanks  for given me a sample for display image in word and excel document.

And I have one more question for you. In my another app I am using
     <editors:TextBoxExt  x:Name="cmb_AC_ID" SearchItemPath="AC_ID" SuggestionPopupClosed="cmb_AC_ID_SuggestionPopupClosed"
 Watermark="" FontSize="13"  SuggestionMode="StartsWith"  AutoCompleteMode="Suggest"/>
In this control, when I open this page in edit mode, This control filled with value but that seems to get stuck in the ON position.
I have attached a screenshot for you better understanding.pls find attachment. see Aircraft Type field in this screenshot.



Untitled_4cb44fa6.rar


SM Suresh M Syncfusion Team July 9, 2013 07:30 AM UTC

Hi Sandeep,

 

Thank you for your reponse,

 

Regarding Upgradation:

 

Whenever you upgrade to newer version it is not necessary to uninstall the older version because Syncfusion supports multiple versions to be installed in the same machine. So, you can install the latest version Essential Studio WINRT(XAML) setup with the respective version unlock key as you wish.

 

Regarding issue with SfTextBoxExt control

 

We are unable to reproduce the reported SfTextBoxExt gets stuck in the ON position issue. Please find the sample used for replication from the following location,

 

http://www.syncfusion.com/downloads/Support/DirectTrac/General/AutoCompleteSample-743188818.zip

 

Please modify the sample to reproduce the issue or provide us more information to assist you further with accurate solution.

 

Please let us know if you have any concerns.

 

Thanks,

Suresh

 

 

 



SA sandeep July 10, 2013 11:34 AM UTC

Hi Suresh,
Thanks for ur support. and also so much thanks for your reply of each questions.
Now I modified ur sample (AutoCompleteSample) and reproduc  the same error which occurs at my end. pls find the attachment.
In this I filled this by country list and suppose I want "USA" selected by default or any other.
Waiting for your reply.


AutoCompleteSample_1c10661.rar


SA sandeep July 10, 2013 12:26 PM UTC

Hi
Can I make my app with this version of control  for windows store without purchasing it ?
Or have to purchase ?



VV Vignesh V Syncfusion Team July 11, 2013 08:49 AM UTC

Hi Sandeep,

We are able to reproduce the issue 'SuggestionBox stays open when default display is given' in 10.4.0.57 version and we have already fixed this issue in Syncfusion latest  versions.

Please find the latest version download link under the following location,

http://www.syncfusion.com/downloads/latest-version

Please let us know if you have any queries.

Regards,
Vignesh V


SA sandeep July 12, 2013 10:00 AM UTC

Hi
But your latest version of sync fusion is not free.


VV Vignesh V Syncfusion Team July 15, 2013 12:38 PM UTC

Hi Sandeep,

We have provided option for downloading evaluation of the latest version. Please downnload from the below link and check if the issue is fixed at your end.

http://www.syncfusion.com/downloads/evalconfirmation

Please let us know if you have any queries.

Regards,
Vignesh V


SA sandeep July 16, 2013 10:17 AM UTC

Hi Vignesh,
I want to ask you, your  sync fusion latest update is free of cost on not? like beeta version.


VV Vignesh V Syncfusion Team August 22, 2013 09:28 AM UTC

Hi Sandeep,

Please, do contact salessupport@syncfusion.com for any queries related to your license and cost details and you will be given prompt assistance.

Regards,
Vignesh V

Loader.
Live Chat Icon For mobile
Up arrow icon