VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging.Pdf.Tree Namespace / PdfPage Class / Render Method / Render(RectangleF,Single) Method
Rectangle on PDF page.
Scale factor.
Example



In This Topic
    Render(RectangleF,Single) Method
    In This Topic
    Renders specified rectangle of PDF page with specified scale.
    Syntax
    'Declaration
     
    Public Overloads Function Render( _
       ByVal rect As RectangleF, _
       ByVal scale As Single _
    ) As VintasoftImage
    public VintasoftImage Render( 
       RectangleF rect,
       float scale
    )
    public: VintasoftImage* Render( 
       RectangleF rect,
       float scale
    ) 
    public:
    VintasoftImage^ Render( 
       RectangleF rect,
       float scale
    ) 

    Parameters

    rect
    Rectangle on PDF page.
    scale
    Scale factor.
    Example
    This example shows how to render a PDF page region with 600x600 dpi resolution.
    ''' <summary>
    ''' Gets region of PDF page with 600x600 resolution.
    ''' </summary>
    ''' <param name="page">The page of PDF document.</param>
    ''' <param name="region">The region of page.</param>
    Public Shared Function GetImage600dpiRegion(page As Vintasoft.Imaging.Pdf.Tree.PdfPage, region As System.Drawing.RectangleF) As Vintasoft.Imaging.VintasoftImage
    	' get the rendering settings of PDF document
    	Dim renderingSettings As Vintasoft.Imaging.Pdf.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(600, 600)
                
    	' render region of PDF page
    	Dim image As Vintasoft.Imaging.VintasoftImage = page.Render(region, 1F)
                
    	' restore resolution of rendering settings
    	renderingSettings.Resolution = prevResolution
                
    	' return the image
    	Return image
    End Function
    /// <summary>
    /// Gets region of PDF page with 600x600 resolution.
    /// </summary>
    /// <param name="page">The page of PDF document.</param>
    /// <param name="region">The region of page.</param>
    public static Vintasoft.Imaging.VintasoftImage GetImage600dpiRegion(
        Vintasoft.Imaging.Pdf.Tree.PdfPage page, System.Drawing.RectangleF region)
    {
        // get the rendering settings of PDF document
        Vintasoft.Imaging.Pdf.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(600, 600);
                
        // render region of PDF page
        Vintasoft.Imaging.VintasoftImage image = page.Render(region, 1.0f);
                
        // restore resolution of rendering settings
        renderingSettings.Resolution = prevResolution;
                
        // return the image
        return image;
    }
    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also