PdfFocusRenderPages Property |
Allows to specify a set of page ranges for converting
Namespace: SautinSoftAssembly: SautinSoft.PdfFocus (in SautinSoft.PdfFocus.dll) Version: 2024.12.18
Syntax public int[][] RenderPages { get; set; }
Public Property RenderPages As Integer()()
Get
Set
Property Value
Int32Remarks
Let us say, we decide to convert these page ranges: 1 to 2, 5 to 7.
The code in C# will look so:
f.RenderPages = new int[][]
{
new int [] {1,2},
new int [] {5,7}
};
Example Convert diapason of PDF pages to Word using C#
using System;
using System.IO;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
string inpFile = Path.GetFullPath(@"..\..\..\Potato Beetle.pdf");
string outFile = "Result.rtf";
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
f.OpenPdf(inpFile);
if (f.PageCount > 0)
{
f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Rtf;
f.RenderPagesString = "2-4, 6";
f.RenderPages = new int[][] {new int[] {2, 4},
new int[] {6, 6}};
int result = f.ToWord(outFile);
if (result == 0)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(outFile) { UseShellExecute = true });
}
}
}
}
}
Convert diapason of PDF pages to Word using VB.Net
Imports System.IO
Imports System.Drawing.Imaging
Imports System.Collections.Generic
Imports SautinSoft
Module Sample
Sub Main()
Dim inpFile As String = Path.GetFullPath("..\..\..\Potato Beetle.pdf")
Dim outFile As String = "Result.rtf"
Dim f As New SautinSoft.PdfFocus()
f.OpenPdf(inpFile)
If f.PageCount > 0 Then
f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Rtf
f.RenderPagesString = "2-4, 6"
f.RenderPages = New Integer()() {
New Integer() {2, 4},
New Integer() {6, 6}
}
Dim result As Integer = f.ToWord(outFile)
If result = 0 Then
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(outFile) With {.UseShellExecute = True})
End If
End If
End Sub
End Module
See Also