VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging.Pdf.Tree Namespace / PdfPage Class / Render Method / Render() Method
Example



In This Topic
    Render() Method
    In This Topic
    Returns the rendered image of the page.
    Syntax
    'Declaration
     
    Public Overloads Function Render() As VintasoftImage
    public VintasoftImage Render()
    public: VintasoftImage* Render(); 
    public:
    VintasoftImage^ Render(); 

    Return Value

    Rendered image of the page.
    Example
    This example shows how to render a PDF page with 300x300 dpi resolution.
    ''' <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.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(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.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(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;
    }
    Requirements

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

    See Also