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

How do I view included pdf in the project?

I'm sorry for wasting your time.  This seems simple, but all the examples only show showing pdf files from picker.  I can't seem to find any example for showing a pdf file that is included in the project.  What is the code for this?  Thank you for being patient with me.


1 Reply

SM Suresh M Syncfusion Team January 6, 2014 05:20 AM UTC

Hi Nate,

 

Thank you for using Syncfusion products.

 

Please find the sample available in the link below which demonstrates loading PDF document (Barcode.pdf) which is included in the project with the build action set to Embedded Resource. Also find the code snippet to do the same below.

 

Code snippet:

Assembly assembly = typeof(MainPage).GetTypeInfo().Assembly;

Stream fileStream = assembly.GetManifestResourceStream("PDFViewerWintRT.Assets.Pdf.Barcode.pdf");

byte[] buffer = new byte[fileStream.Length];

fileStream.Read(buffer, 0, buffer.Length);

PdfLoadedDocument ldoc = new PdfLoadedDocument(buffer, "syncfusion");

           

pdfViewer.LoadDocument(ldoc);

 

Sample Link: PDFViewerWintRT_2013.zip

 

Please let us know if you need any further assistance.

 

Thanks,

Suresh


Loader.
Live Chat Icon For mobile
Up arrow icon