Возвращает визуализированное изображение страницы.
Return Value
Визуализированное изображение страницы.
Вот пример, показывающий, как визуализировать PDF страницу с разрешением 300x300 точек на дюйм:
''' <summary>
''' Gets PDF page with 300x300 resolution.
''' </summary>
''' <param name="page">The page of PDF document.</param>
Public Shared Function GetImage300dpi(page As Vintasoft.Imaging.Pdf.Tree.PdfPage) As Vintasoft.Imaging.VintasoftImage
' get the rendering settings of PDF document
Dim renderingSettings As Vintasoft.Imaging.Codecs.Decoders.PdfRenderingSettings = page.Document.RenderingSettings
' save previous resolution of rendering settings
Dim prevResolution As Vintasoft.Imaging.Resolution = renderingSettings.Resolution
' set new resolution for image rendering
renderingSettings.Resolution = New Vintasoft.Imaging.Resolution(300, 300)
' render image of the page
Dim image As Vintasoft.Imaging.VintasoftImage = page.Render()
' restore resolution of rendering settings
renderingSettings.Resolution = prevResolution
' return the image
Return image
End Function
/// <summary>
/// Gets PDF page with 300x300 resolution.
/// </summary>
/// <param name="page">The page of PDF document.</param>
public static Vintasoft.Imaging.VintasoftImage GetImage300dpi(
Vintasoft.Imaging.Pdf.Tree.PdfPage page)
{
// get the rendering settings of PDF document
Vintasoft.Imaging.Codecs.Decoders.PdfRenderingSettings renderingSettings = page.Document.RenderingSettings;
// save previous resolution of rendering settings
Vintasoft.Imaging.Resolution prevResolution = renderingSettings.Resolution;
// set new resolution for image rendering
renderingSettings.Resolution = new Vintasoft.Imaging.Resolution(300, 300);
// render image of the page
Vintasoft.Imaging.VintasoftImage image = page.Render();
// restore resolution of rendering settings
renderingSettings.Resolution = prevResolution;
// return the image
return image;
}
Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5