ComponentOne Studio UWP Edition adds a new object for viewing PDF Files in FlexViewer. The new PDFDocumentSource (Beta) helps you to bind FlexViewer with PDF files using simple lines of code. At the same time, you can take advantage of advanced viewing features on PDF.
Step 1: Create new C1PDFDocumentSource object:
C1PdfDocumentSource _pdfDocSource = new C1PdfDocumentSource();
Step 2: Load file into the Memory Stream:
var memStream = new MemoryStream();
using (Stream stream = \_asm.GetManifestResourceStream("Sample\_ExportType.Resources." + "Sample\_GCDataSheet\_2016.pdf"))
{ await stream.CopyToAsync(memStream);
memStream.Position = 0; }
Step 3: Load memory stream into C1PDFDocumentSource object:
await _pdfDocSource.LoadFromStreamAsync(memStream);
Step 4: Bind FlexViewer's DocumentSource object with C1PDFDocumentSource:
flexViewer.DocumentSource = _pdfDocSource;
And you're done! Here's how the PDF looks when loaded into the FlexViewer:
Step 3: Choose PDF File (say, TelephoneBill.pdf) and click open:
That's it! Here's how the PDF looks:
Thumbnails: You can use the Thumbnails icon to view a Thumbnail view of PDF pages which can help you to jump to specific page in the document.
[](//gccontent.blob.core.windows.net/gccontent/blogs/legacy/c1/2016/09/View.png)
* You can rotate the PDF using 'Rotate Clockwise' option:
[](//gccontent.blob.core.windows.net/gccontent/blogs/legacy/c1/2016/09/RotatedPDF.png)
* Or, you can choose to read PDF pages side by side using "Two Pages" option:
[](//gccontent.blob.core.windows.net/gccontent/blogs/legacy/c1/2016/09/TwoFacePaging.png)
Check out the FlexPdfViewer sample to view above features and share your feedback with us below! Thanks!