How do I open a specific PDF page with Xamarin (iOS)?

Asked

Viewed 36 times

2

I use the following code to open a PDF document.

I would like to know how to open the PDF on a specific page, because every time I run the code, the document opens at the beginning.

public void OpenFile(string targetPath)
{
    try
    {
        Device.BeginInvokeOnMainThread(() =>
        {
            QLPreviewItemFileSystem prevItem = new QLPreviewItemFileSystem(_name, targetPath);
            QLPreviewController previewController = new QLPreviewController();
            previewController.DataSource = new PreviewControllerDS(prevItem);
            UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(previewController, true, null);
        });
    }
    catch(Exception ex)
    {
        Debug.WriteLine(ex);
    }
}

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.