Click or drag to resize

PdfFocusOpenPdf(Uri) Method

Open PDF document as Uri.

Namespace: SautinSoft
Assembly: SautinSoft.PdfFocus (in SautinSoft.PdfFocus.dll) Version: 2024.3.28
Syntax
public void OpenPdf(
	Uri uri
)

Parameters

uri  Uri
Uri path to the PDF document.
Example
How to convert URL-PDF from Internet to a Word file in C#
using System;
using System.IO;

namespace Sample
{
    class Sample
    {
        static void Main(string[] args)
        {
            string remotePdfUrl = @"https://www.sautinsoft.net/Download/Samples/simple-text.pdf";
            string pathToWord = @"Result.docx";
                                  // Get your free 30-day key here:   
             // https://sautinsoft.com/start-for-free/

            //Convert URL-PDF from Internet to a Word file
            SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();

            Uri uri = new Uri(remotePdfUrl);

            f.OpenPdf(uri);

            if (f.PageCount > 0)
            {
                int result = f.ToWord(pathToWord);

                //Show the resulting Word document
                if (result == 0)
                {
                    System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(pathToWord) { UseShellExecute = true });
                }
            }
        }
    }
}
How to convert URL-PDF from Internet to a Word file in VB.Net
Imports System.IO
Imports System.Drawing.Imaging
Imports System.Collections.Generic
Imports SautinSoft

Module Sample

    Sub Main()
        Dim remotePdfUrl As String = "https://www.sautinsoft.net/Download/Samples/simple-text.pdf"
        Dim pathToWord As String = "Result.docx"
                                ' Get your free 30-day key here: 
                                ' https://sautinsoft.com/start-for-free/

        'Convert URL-PDF from Internet to a Word file
        Dim f As New SautinSoft.PdfFocus()

        Dim uri As New Uri(remotePdfUrl)

        f.OpenPdf(uri)

        If f.PageCount > 0 Then
            Dim result As Integer = f.ToWord(pathToWord)

            'Show the resulting Word document
            If result = 0 Then
                System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(pathToWord) With {.UseShellExecute = True})
            End If
        End If
    End Sub
End Module
See Also