Viscomsoft UWP PDF Viewer SDK

DocumentFactory.CreateDocument Method

 

Before load the document, you need create empty document. It support pdf, bmp, png, jpg, tif file.
 
 C#

public IDocument CreateDocument(string fileName)

 


Parameter
fileName - the file name of the document

Namespace: Viscomsoft.UWP.PDFViewerSDK;

Return Value
Return the IDocument object.

Example

   

[C# Syntax] 
using Viscomsoft.UWP.PDFViewerSDK;
   
private async void open(StorageFile file)
{
    DocumentFactory factory = new DocumentFactory();

    IDocument doc = factory.CreateDocument(file.Name);

    bool opened = await doc.OpenAsync(file);
 

    _pdfDisplayManager = new PDFDisplayManager();

    _pdfDisplayManager.Width = (int)Window.Current.Bounds.Width;

    _pdfDisplayManager.Height = (int)Window.Current.Bounds.Height;

    _pdfDisplayManager.Document = doc;

    _pdfDisplayManager.GotoPage(1);

    uiViewPanel.Child = createScrollViewControl();
}