
PickSingleFolderAsync () //Create a cancellation token to cancel the image rendering instantly. Add ( "*" ) StorageFolder storageFolder = await folderPicker. FolderPicker folderPicker = new FolderPicker () folderPicker. ChartToImageConverter = new ChartToImageConverter () //Pick the folder to save the converted images. OpenAsync ( inputFile ) //Initialize the ChartToImageConverter instance to convert the charts in the slides. PickSingleFileAsync () pptxDoc = await Presentation. Add ( ".pptx" ) StorageFile inputFile = await openPicker. Load the presentation file using open picker FileOpenPicker openPicker = new FileOpenPicker () openPicker.
#Convert powerpoint to png how to
The following code snippet demonstrates how to convert a PowerPoint slide to image by passing ‘CancellationToken’. SaveAsImageAsync ( imageStream, renderingOptions ) //Closes the presentation instance pptxDoc. ScaleY = 10F //Convert the slide to image with specified resolution. ScaleX = 10F //Sets the vertical scaling value for the converted image. RenderingOptions renderingOptions = new RenderingOptions () //Sets the horizontal scaling value for the converted image. OpenStreamForWriteAsync () //Creates a new instance for the rendering options to customize the image resolution. StorageFile imageStream = await imageFile. ReplaceExisting ) //Get the stream of the created image file. CreateFileAsync ( "Slide1.jpg", CreationCollisionOption. PickSingleFolderAsync () StorageFile imageFile = await storageFolder. OpenAsync ( inputFile ) //Initialize the ‘ChartToImageConverter’ instance to convert the charts in the slides. The following code snippet demonstrates how to convert a PowerPoint slide to image using custom image resolution. SaveAsImageAsync ( imageFile ) //Closes the presentation instance pptxDoc. ReplaceExisting ) //Convert the slide to image.

OpenAsync ( inputFile ) //Initialize the ‘ChartToImageConverter’ instance to convert the charts in the slides pptxDoc.

The following code example demonstrates how to convert a slide to image in UWP. This assembly is used to convert Office Chart into Image. This assembly contains the Office Chart Object model and core features needed for chart creation. This assembly contains the core features needed for creating, reading, manipulating a Presentation file. The following assemblies are required in the UWP application to convert the slides as images. PowerPoint slides can be converted to images in UWP by using Essential Presentation library. ToString () + ".jpeg" ) 'Closes the presentation pptxDoc. Height )) 'Saves the image as bitmap bitmap. FromStream ( stream ), New Rectangle ( 0, 0, bitmap. DpiY ) 'Recreates the image in custom size imageGraphics. FromImage ( bitmap ) 'Sets the resolution bitmap. Format32bppPArgb ) 'Gets the graphics from image Dim imageGraphics As Graphics = Graphics. Emf ) 'Creates a bitmap of specific width and height Dim bitmap As New Bitmap ( customWidth, customHeight, PixelFormat. Open ( "Output.pptx" ) 'Declare variables to hold custom width and height Dim customWidth As Integer = 1500 Dim customHeight As Integer = 1000 'Converts the slide as image and returns the image stream Dim stream As Stream = pptxDoc.

'Loads the PowerPoint presentation Dim pptxDoc As IPresentation = Presentation.
