Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. aspose-com-kb revised this gist Feb 5, 2023. No changes.
  2. aspose-com-kb revised this gist Feb 3, 2023. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions How to Convert SVG to Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -16,13 +16,13 @@
    svgContent = svgfile.read().rstrip()
    ppSVGImage = slides.SvgImage(svgContent)

    #Add the SVG Image inside the images collection of the presentation
    #Add an SVG Image from the disk inside the images collection of the presentation
    svgImageForSlide = sampleSvgPres.images.add_image(ppSVGImage)

    # Create a picture frame in the shapes collection of the slide
    #Insert a picture frame inside the shapes collection of the slide
    slideForSvg.shapes.add_picture_frame(slides.ShapeType.RECTANGLE, 0, 0, 720, 540, svgImageForSlide)

    #Save the PPTX presentation with an SVG image on the disk
    #Save the presentation in PPTX format with an SVG image on the disk
    slideForSvg.save(filepath + "PresentationWithSvg.pptx", slides.export.SaveFormat.PPTX)

    print("Process Completed")
  3. aspose-com-kb revised this gist Feb 3, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion How to Convert SVG to Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    import aspose.slides as slides
    filepath = "C://Words//"

    # Applying the licence for Aspose.Slides to insert SVG
    #Applying the licence for Aspose.Slides to convert SVG to PPTX
    svgtoSlidesLicense = slides.License()
    svgtoSlidesLicense.set_license(filepath + "Conholdate.Total.Product.Family.lic")

  4. aspose-com-kb revised this gist Feb 3, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions How to Convert SVG to Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -16,13 +16,13 @@
    svgContent = svgfile.read().rstrip()
    ppSVGImage = slides.SvgImage(svgContent)

    # Add the SVG Image inside the images collection of the presentation
    #Add the SVG Image inside the images collection of the presentation
    svgImageForSlide = sampleSvgPres.images.add_image(ppSVGImage)

    # Create a picture frame in the shapes collection of the slide
    slideForSvg.shapes.add_picture_frame(slides.ShapeType.RECTANGLE, 0, 0, 720, 540, svgImageForSlide)

    # Save the PPTX with SVG on the disk
    #Save the PPTX presentation with an SVG image on the disk
    slideForSvg.save(filepath + "PresentationWithSvg.pptx", slides.export.SaveFormat.PPTX)

    print("Process Completed")
  5. aspose-com-kb revised this gist Feb 3, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion How to Convert SVG to Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@
    #Access the first slide of the newly created presentation
    slideForSvg = sampleSvgPres.slides[0]

    #Access the SVG file content and add that inside the presentation image collection
    #Load the SVG file content and insert that inside the presentation image collection
    with open(filepath + "410.svg", 'r') as svgfile:
    svgContent = svgfile.read().rstrip()
    ppSVGImage = slides.SvgImage(svgContent)
  6. aspose-com-kb revised this gist Feb 3, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions How to Convert SVG to Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -8,15 +8,15 @@
    # Make an empty presentation using the Presentation class object
    with slides.Presentation() as sampleSvgPres:

    # Access the first slide of the newly created presentation
    #Access the first slide of the newly created presentation
    slideForSvg = sampleSvgPres.slides[0]

    #Access the SVG file content and add that inside the presentation image collection
    with open(filepath + "410.svg", 'r') as svgfile:
    svgContent = svgfile.read().rstrip()
    ppSVGImage = slides.SvgImage(svgContent)

    # Include the Image inside the images collection of the presentation
    # Add the SVG Image inside the images collection of the presentation
    svgImageForSlide = sampleSvgPres.images.add_image(ppSVGImage)

    # Create a picture frame in the shapes collection of the slide
  7. aspose-com-kb revised this gist Feb 3, 2023. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions How to Convert SVG to Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    import aspose.slides as slides
    filepath = "C://Words//"

    # Applying the linence for Aspose.Slides to insert SVG
    # Applying the licence for Aspose.Slides to insert SVG
    svgtoSlidesLicense = slides.License()
    svgtoSlidesLicense.set_license(filepath + "Conholdate.Total.Product.Family.lic")

    # Make an empty presentation using Presentation class object
    # Make an empty presentation using the Presentation class object
    with slides.Presentation() as sampleSvgPres:

    # Access the first slide of the newly created presentation
    @@ -22,7 +22,7 @@
    # Create a picture frame in the shapes collection of the slide
    slideForSvg.shapes.add_picture_frame(slides.ShapeType.RECTANGLE, 0, 0, 720, 540, svgImageForSlide)

    # Save the merged presentations as PDF on the disk
    # Save the PPTX with SVG on the disk
    slideForSvg.save(filepath + "PresentationWithSvg.pptx", slides.export.SaveFormat.PPTX)

    print("Process Completed")
  8. aspose-com-kb renamed this gist Feb 3, 2023. 1 changed file with 0 additions and 0 deletions.
  9. aspose-com-kb revised this gist Feb 3, 2023. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions How to Insert SVG in Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -14,8 +14,7 @@
    #Access the SVG file content and add that inside the presentation image collection
    with open(filepath + "410.svg", 'r') as svgfile:
    svgContent = svgfile.read().rstrip()
    #var svgContent = System.IO.File.ReadAllText(filesPath + "410.svg");
    svgImage = slides.SvgImage(svgContent)
    ppSVGImage = slides.SvgImage(svgContent)

    # Include the Image inside the images collection of the presentation
    svgImageForSlide = sampleSvgPres.images.add_image(ppSVGImage)
  10. aspose-com-kb revised this gist Feb 3, 2023. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion How to Insert SVG in Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,6 @@
    svgContent = svgfile.read().rstrip()
    #var svgContent = System.IO.File.ReadAllText(filesPath + "410.svg");
    svgImage = slides.SvgImage(svgContent)
    ppSVGImage = sampleSvgPres.images.add_image(svgImage);

    # Include the Image inside the images collection of the presentation
    svgImageForSlide = sampleSvgPres.images.add_image(ppSVGImage)
  11. aspose-com-kb created this gist Feb 3, 2023.
    31 changes: 31 additions & 0 deletions How to Insert SVG in Presentation using Python.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    import aspose.slides as slides
    filepath = "C://Words//"

    # Applying the linence for Aspose.Slides to insert SVG
    svgtoSlidesLicense = slides.License()
    svgtoSlidesLicense.set_license(filepath + "Conholdate.Total.Product.Family.lic")

    # Make an empty presentation using Presentation class object
    with slides.Presentation() as sampleSvgPres:

    # Access the first slide of the newly created presentation
    slideForSvg = sampleSvgPres.slides[0]

    #Access the SVG file content and add that inside the presentation image collection
    with open(filepath + "410.svg", 'r') as svgfile:
    svgContent = svgfile.read().rstrip()
    #var svgContent = System.IO.File.ReadAllText(filesPath + "410.svg");
    svgImage = slides.SvgImage(svgContent)
    ppSVGImage = sampleSvgPres.images.add_image(svgImage);

    # Include the Image inside the images collection of the presentation
    svgImageForSlide = sampleSvgPres.images.add_image(ppSVGImage)

    # Create a picture frame in the shapes collection of the slide
    slideForSvg.shapes.add_picture_frame(slides.ShapeType.RECTANGLE, 0, 0, 720, 540, svgImageForSlide)

    # Save the merged presentations as PDF on the disk
    slideForSvg.save(filepath + "PresentationWithSvg.pptx", slides.export.SaveFormat.PPTX)

    print("Process Completed")