Python: Extract Hyperlinks from Word Documents
MS Word allows users to view hyperlinks but lacks a built-in feature for extracting hyperlinks with a single click. This limitation makes extracting multiple links from a document time-consuming. Thankfully, Python can streamline this process significantly. In this article, we'll show you how to use Spire.Doc for Python to easily extract hyperlinks from Word documents with Python, either individual or batch, saving you time and effort.
Install Spire.Doc for Python
This scenario requires Spire.Doc for Python and plum-dispatch v1.7.4. They can be easily installed in your Windows through the following pip command.
pip install Spire.Doc
If you are unsure how to install, please refer to this tutorial: How to Install Spire.Doc for Python on Windows.
Extract Hyperlinks from Word Documents: Specified Links
Whether you're looking to retrieve just one important link or filter out certain URLs, this section will guide you through the process step by step. Using the Filed.FiledText and the Filed.Code properties provided by Spire.Doc, you can efficiently target and extract specified hyperlinks, making it easier to access the information you need.
Steps to extract specified hyperlinks from Word documents:
- Create an instance of Document class.
- Read a Word document from files using Document.LoadFromFile() method.
- Iterate through elements to find all hyperlinks in this Word document.
- Get a certain hyperlink from the hyperlink collection.
- Retrieve the hyperlink text with Field.FieldText property.
- Extract URLs from the hyperlink in the Word document using Field.Code property.
Here is the code example of extracting the first hyperlink in a Word document:
- Python
from spire.doc import * from spire.doc.common import * # Create a Document object doc = Document() # Load a Word file doc.LoadFromFile("/sample.docx") # Find all hyperlinks in the Word document hyperlinks = [] for i in range(doc.Sections.Count): section = doc.Sections.get_Item(i) for j in range(section.Body.ChildObjects.Count): sec = section.Body.ChildObjects.get_Item(j) if sec.DocumentObjectType == DocumentObjectType.Paragraph: for k in range((sec if isinstance(sec, Paragraph) else None).ChildObjects.Count): para = (sec if isinstance(sec, Paragraph) else None).ChildObjects.get_Item(k) if para.DocumentObjectType == DocumentObjectType.Field: field = para if isinstance(para, Field) else None if field.Type == FieldType.FieldHyperlink: hyperlinks.append(field) # Get the first hyperlink text and URL if hyperlinks: first_hyperlink = hyperlinks[0] hyperlink_text = first_hyperlink.FieldText hyperlink_url = first_hyperlink.Code.split('HYPERLINK ')[1].strip('"') # Save to a text file with open("/FirstHyperlink.txt", "w") as file: file.write(f"Text: {hyperlink_text}\nURL: {hyperlink_url}\n") # Close the document doc.Close()
Extract All Hyperlinks from Word Documents
After checking out how to extract specified hyperlinks, let's move on to extracting all hyperlinks from your Word documents. This is especially helpful when you need a list of all links, whether to check for broken ones or for other purposes. By automating this process with Spire.Doc(short for Spire Doc for Python), you can save time and ensure accuracy. Let's take a closer look at the steps and code example. Steps to extract all hyperlinks from Word documents:
- Create a Document object.
- Load a Word document from the local storage with Document.LoadFromFile() method.
- Loop through elements to find all hyperlinks in the Word document.
- Iterate through all hyperlinks in the collection.
- Use Field.FieldText property to extract the hyperlink text from each link.
- Use Field.Code property to get URLs from hyperlinks.
Below is a code example of extracting all hyperlinks from a Word document:
- Python
from spire.doc import * from spire.doc.common import * # Create a Document object doc = Document() # Load a Word file doc.LoadFromFile("/sample.docx") # Find all hyperlinks in the Word document hyperlinks = [] for i in range(doc.Sections.Count): section = doc.Sections.get_Item(i) for j in range(section.Body.ChildObjects.Count): sec = section.Body.ChildObjects.get_Item(j) if sec.DocumentObjectType == DocumentObjectType.Paragraph: for k in range((sec if isinstance(sec, Paragraph) else None).ChildObjects.Count): para = (sec if isinstance(sec, Paragraph) else None).ChildObjects.get_Item(k) if para.DocumentObjectType == DocumentObjectType.Field: field = para if isinstance(para, Field) else None if field.Type == FieldType.FieldHyperlink: hyperlinks.append(field) # Save all hyperlinks text and URL to a text file with open("/AllHyperlinks.txt", "w") as file: for i, hyperlink in enumerate(hyperlinks): hyperlink_text = hyperlink.FieldText hyperlink_url = hyperlink.Code.split('HYPERLINK ')[1].strip('"') file.write(f"Hyperlink {i+1}:\nText: {hyperlink_text}\nURL: {hyperlink_url}\n\n") # Close the document doc.Close()
Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
C#: Insert, Retrieve, Reorder and Remove Slides in PowerPoint Sections
Sections in PowerPoint let you group related slides together, making it easy to segment a presentation by topics, chapters, or any other logical structure. When working with large, multi-section presentations, automating slide operations - such as insertion, retrieval, reordering, and removal - can significantly improve productivity. In this article, we will explain how to insert, retrieve, reorder, and remove slides in PPT sections in C# using Spire.Presentation for .NET.
- Insert Slides into a PowerPoint Section in C#
- Retrieve Slides from a PowerPoint Section in C#
- Reorder Slides in a PowerPoint Section in C#
- Remove Slides from a PowerPoint Section in C#
Install Spire.Presentation for .NET
To begin with, you need to add the DLL files included in the Spire.Presentation for.NET package as references in your .NET project. The DLL files can be either downloaded from this link or installed via NuGet.
PM> Install-Package Spire.Presentation
Insert Slides into a PowerPoint Section in C#
Inserting slides is often needed when you need to add new content to a section. With Spire.Presentation for .NET, you can insert a slide into a section using the Section.Insert() method. The detailed steps are as follows.
- Create an instance of the Presentation class.
- Load a PowerPoint presentation using the Presentation.LoadFromFile() method.
- Get a specific section through its index (0-based) using the Presentation.SectionList(index) property.
- Add a new slide to presentation, then insert it into the section using the Section.Insert() method.
- Remove the added slide from the presentation.
- Save the resulting presentation using the Presentation.SaveToFile() method.
- C#
using Spire.Presentation; using System.Collections.Generic; namespace InsertSlidesInSection { internal class Program { static void Main(string[] args) { // Create an instance of the Presentation class using (Presentation presentation = new Presentation()) { // Load a PowerPoint presentation presentation.LoadFromFile("Example.pptx"); // Access the first section Section firstSection = presentation.SectionList[0]; // Add a new slide to the presentation and insert it at the start of the section ISlide slide = presentation.Slides.Append(); firstSection.Insert(0, slide); // Remove the added slide from the presentation presentation.Slides.Remove(slide); // Save the modified presentation presentation.SaveToFile("InsertSlidesInSection.pptx", FileFormat.Pptx2016); } } } }
Retrieve Slides from a PowerPoint Section in C#
Extracting slides from a specific section allows you to focus on a subset of slides for targeted operations, like slide reordering or applying specific formatting. Using the Section.GetSlides() method in Spire.Presentation for .NET, you can easily retrieve all slides within a given section. The detailed steps are as follows.
- Create an instance of the Presentation class.
- Load a PowerPoint presentation using the Presentation.LoadFromFile() method.
- Get a specific section through its index (0-based) using the Presentation.SectionList(index) property.
- Retrieve the slides within the section using the Section.GetSlides() method.
- Iterate through the retrieved slides and get the slide number (1-based) of each slide.
- C#
using Spire.Presentation; using System; namespace RetrieveSlidesInSection { internal class Program { static void Main(string[] args) { // Create an instance of the Presentation class using (Presentation presentation = new Presentation()) { // Load a PowerPoint presentation presentation.LoadFromFile("Example.pptx"); // Retrieve the slides in the 3rd section Section section = presentation.SectionList[2]; ISlide[] slides = section.GetSlides(); // Output the slide number for each slide in the section foreach (ISlide slide in slides) { Console.Write(slide.SlideNumber + " "); } Console.ReadKey(); } } } }
Reorder Slides in a PowerPoint Section in C#
Reordering slides is essential for ensuring that related content follows a logical sequence. Spire.Presentation for .NET offers the Section.Move() method for moving a slide in a section to another position. The detailed steps are as follows.
- Create an instance of the Presentation class.
- Load a PowerPoint presentation using the Presentation.LoadFromFile() method.
- Get a specific section through its index (0-based) using the Presentation.SectionList(index) property.
- Move a specific slide in the section to another position using the Section.Move() method.
- Save the resulting presentation using the Presentation.SaveToFile() method.
- C#
using Spire.Presentation; namespace ReorderSlidesInSection { internal class Program { static void Main(string[] args) { // Create an instance of the Presentation class using (Presentation presentation = new Presentation()) { // Load a PowerPoint presentation presentation.LoadFromFile("Example.pptx"); // Access the 3rd section Section section = presentation.SectionList[2]; // Retrieve the slides in the section ISlide[] slides = section.GetSlides(); // Move the 1st slide in the section to the specified position section.Move(2, slides[0]); // Save the modified presentation presentation.SaveToFile("ReorderSlidesInSection.pptx", FileFormat.Pptx2016); } } } }
Remove Slides from a PowerPoint Section in C#
Removing slides from a section helps streamline your presentation, especially when certain slides become outdated or irrelevant. With the Section.RemoveAt() or Section.RemoveRange() method in Spire.Presentation for .NET, you can easily delete an individual slide or a range of slides from a section. The detailed steps are as follows.
- Create an instance of the Presentation class.
- Load a PowerPoint presentation using the Presentation.LoadFromFile() method.
- Get a specific section through its index (0-based) using the Presentation.SectionList(index) property.
- Remove a specific slide or a range of slides from the presentation using the Section.RemoveAt() or Section.RemoveRange() method.
- Save the resulting presentation using the Presentation.SaveToFile() method.
- C#
using Spire.Presentation; namespace RemoveSlidesInSection { internal class Program { static void Main(string[] args) { // Create an instance of the Presentation class using (Presentation presentation = new Presentation()) { // Load a PowerPoint presentation presentation.LoadFromFile("Course.pptx"); // Access the 3rd section Section section = presentation.SectionList[2]; // Remove the first slide from the section section.RemoveAt(0); // Or remove a range of slides from the section //section.RemoveRange(0, 2); // Save the modified presentation presentation.SaveToFile("RemoveSlidesInSection.pptx", FileFormat.Pptx2016); } } } }
Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
Spire.Presentation 9.11.3 support setting whether to save SlidePicture shapes as graphic tags when converting PowerPoint to SVG
We're glad to announce the release of Spire.Presentation 9.11.3. This version adds a new property to set whether to save SlidePicture shapes as graphic tags when converting PPTX to SVG, and also fix several issues that occurred when converting PPTX to PDFA/SVG, and loading PowerPoint files. Check below for more details.
Here is a list of changes made in this release
Category | ID | Description |
New feature | SPIREPPT-2636 | Adds a new boolean property "ppt.SaveToSvgOption.ConvertPictureUsingGraphicTag" to set whether to save SlidePicture shapes as graphic tags when converting PPTX to SVG.
ppt.SaveToSvgOption.ConvertPictureUsingGraphicTag = true; |
Bug | SPIREPPT-2552 | Fixes the issue that PDFA standards were not applied when converting PPTX documents to PDFA documents. |
Bug | SPIREPPT-2615 | Fixes the issue that the text direction was incorrect when converting PPTX documents to SVG files. |
Bug | SPIREPPT-2628 | Fixes the issue that the background color was incorrect when using the "shape.SaveAsSvgInSlide()" method to convert to SVG documents. |
Bug | SPIREPPT-2629 | Fixes the issue that the text was not properly aligned when converting slides to SVG documents. |
Bug | SPIREPPT-2631 | Fixes the issue that the application threw "System.NullReferenceException: Object reference not set to an instance of an object" exception when loading PPTX documents. |
Spire.Presentation for Python 9.11.1 supports the functionality to get the slides from "section"
We are pleased to announce the release of Spire.Presentation for Python 9.11.1. The latest version supports the functionality to get the slides from "section". Moreover, some known bugs are fixed successfully in this update, such as the issue that errors occurred when using SlideCountPerPageForPrint and ContainingHiddenSlides methods. More details are listed below.
Here is a list of changes made in this release
Category | ID | Description |
New feature | SPIREPPT-2575 | Supports the functionality to get the slides from "section".
ppt = Presentation() ppt.LoadFromFile(inputFile) section=ppt.SectionList[0] slides=section.GetSlides() sb = [] i=0 for slide in slides: sb.append("SlideID:"+str(slides[i].SlideID)) i=i+1 File.AppendAllText(outputFile, sb) ppt.Dispose |
New feature | SPIREPPT-2605 | Supports the functionality to get the Left and Top values of SmartArt.
# Create a Presentation oject presentation = Presentation() # Load a PowerPoint document presentation.LoadFromFile(inputFile) sb = [] # Get custom document properties for shape in presentation.Slides[0].Shapes: if isinstance(shape, ISmartArt): sa = shape if isinstance(shape, ISmartArt) else None sb.append("left: " + str(sa.Left)) sb.append("top: " + str(sa.Top)) File.AppendAllText(outputFile, sb) presentation.Dispose() |
New feature | SPIREPPT-2621 | Supports the DisplayFormat property.
# Create a Presentation oject presentation = Presentation() presentation.LoadFromFile(inputFile) shape = presentation.Slides[0].Shapes[0] textrange = shape.TextFrame.Paragraphs[0].TextRanges[0] displayformat = textrange.DisplayFormat sb = [] sb.append("text :" + str(textrange.Text)) sb.append("is bold :" + str(displayformat.IsBold)) sb.append("is italic :" + str(displayformat.IsItalic)) sb.append("latin_font FontName = :" + str(displayformat.LatinFont.FontName)) File.AppendAllText(outputFile, sb) presentation.Dispose() |
Bug | SPIREPPT-2503 | Fixes the issue that errors occurred when using SlideCountPerPageForPrint and ContainingHiddenSlides methods. |
Bug | SPIREPPT-2564 SPIREPPT-2566 |
Fixes the issue that there were incorrect layouts when converting PPT to PDF. |
Bug | SPIREPPT-2618 | Optimized the time consumption issue of converting PPT to images. |
Python: Convert Text to Multiple Columns in Excel
When importing data from external sources or pasting large volumes of information into Excel, it's common for the data to be placed in a single column. This can make the data difficult to work with, especially when you need to separate it for in-depth analysis. By converting the text into multiple columns, you can create a clearer structure that allows for easier sorting, filtering, and analysis. In this article, we will introduce how to convert text to multiple columns in Excel in Python using Spire.XLS for Python.
Install Spire.XLS for Python
This scenario requires Spire.XLS for Python and plum-dispatch v1.7.4. They can be easily installed in your Windows through the following pip command.
pip install Spire.XLS
If you are unsure how to install, please refer to this tutorial: How to Install Spire.XLS for Python on Windows
Convert Text to Multiple Columns in Excel in Python
Spire.XLS for Python does not offer a direct method for converting text in a cell into multiple columns. However, you can accomplish this by first retrieving the cell content using the CellRange.Text property. Next, use the str.split() method to split the text based on a specified delimiter, such as a comma, space, or semicolon. Finally, write the split data into individual columns. The detailed steps are as follows:
- Create an object of the Workbook class.
- Load an Excel workbook using the Workbook.LoadFromFile() method.
- Access a specific worksheet using the Workbook.Worksheets[index] property.
- Loop through each row in the sheet.
- Get the content of the first cell in the current row using the CellRange.Text property. Next, split the content based on a specified delimiter using the str.split() method, and finally, write the split data into separate columns.
- Automatically adjust column widths in the worksheet using the Worksheet.AllocatedRange.AutoFitColumns() method.
- Save the modified workbook to a new file using the Workbook.SaveToFile() method.
- Python
from spire.xls import * from spire.xls.common import * # Specify the input and output Excel File paths inputFile = "Template.xlsx" outputFile = "ConvertTextToColumns.xlsx" # Create an object of the Workbook class workbook = Workbook() # Load the Excel file workbook.LoadFromFile(inputFile) # Get the first worksheet in the file sheet = workbook.Worksheets[0] # Loop through each row in the worksheet for i in range(sheet.LastRow): # Get the text of the first cell in the current row text = sheet.Range[i + 1, 1].Text # Split the text by comma splitText = text.split(',') # Write the split data into individual columns for j in range(len(splitText)): sheet.Range[i + 1, j + 2].Text = splitText[j] # Automatically adjust column widths in the worksheet sheet.AllocatedRange.AutoFitColumns() # Save the modified Excel file workbook.SaveToFile(outputFile, ExcelVersion.Version2013) workbook.Dispose()
Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
Python: Change PDF Version
PDF files have different versions, each with unique features and compatibility standards. Changing the version of a PDF can be important when specific versions are required for compatibility with certain devices, software, or regulatory requirements. For instance, you may need to use an older PDF version when archiving or sharing files with users using older software. This article will introduce how to change the version of a PDF document in Python using Spire.PDF for Python.
Install Spire.PDF for Python
This scenario requires Spire.PDF for Python and plum-dispatch v1.7.4. They can be easily installed in your Windows through the following pip command.
pip install Spire.PDF
If you are unsure how to install, please refer to this tutorial: How to Install Spire.PDF for Python on Windows
Change PDF Version in Python
Spire.PDF for Python supports PDF versions ranging from 1.0 to 1.7. To convert a PDF file to a different version, simply set the desired version using the PdfDocument.FileInfo.Version property. The detailed steps are as follows.
- Create an object of the PdfDocument class.
- Load a sample PDF document using the PdfDocument.LoadFromFile() method.
- Change the version of the PDF document to a newer or older version using the PdfDocument.FileInfo.Version property.
- Save the resulting document using the PdfDocument.SaveToFile() method.
- Python
from spire.pdf.common import * from spire.pdf import * # Create an object of the PdfDocument class pdf = PdfDocument() # Load a PDF document pdf.LoadFromFile("Example.pdf") # Change the version of the PDF to version 1.7 pdf.FileInfo.Version = PdfVersion.Version1_7 # Save the resulting document pdf.SaveToFile("ChangePDFVersion.pdf") pdf.Close()
Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
Spire.PDF 10.11.1 supports extracting video and audio from PDF documents
We are delighted to announce the release of Spire.PDF 10.11.1. This version supports extracting video and audio from PDF documents. Besides, it enhances the conversion from PDF to images. Moreover, a lot of known issues are fixed successfully in this version, such as the issue that merging PDF documents failed. More details are listed below.
Here is a list of changes made in this release
Category | ID | Description |
New feature | SPIREPDF-7145 | Supported the functionality to extract video and audio from PDF documents.
PdfDocument pdf = new PdfDocument(); pdf.LoadFromFile(inputFile); for (int i = 0; i < pdf.Pages.Count; i++) { PdfPageBase page = pdf.Pages[i]; PdfAnnotationCollection ancoll = page.Annotations; for (int j = 0; j < ancoll.Count; j++) { PdfRichMediaAnnotationWidget MediaWidget = ancoll[j] as PdfRichMediaAnnotationWidget; byte[] data = MediaWidget.RichMediaData; string embedFileName = MediaWidget.RichMediaName; File.WriteAllBytes(outputFile + embedFileName,data); } } |
Bug | SPIREPDF-6786 | Fixes the issue that highlighting text did not work correctly. |
Bug | SPIREPDF-7055 | Fixes the issue that the program threw "Cannot find table 'loca' in the font file" when loading SVG. |
Bug | SPIREPDF-7114 | Fixes the issue that merging PDF documents failed to work. |
Bug | SPIREPDF-7126 | Fixes the issue that page size could not be set using PageSettings.PaperFormat when using ChromeHtmlConverter to convert HTML to PDF. |
Bug | SPIREPDF-7129 | Fixes the issue that the result of PdfDocument.Conformance was incorrect. |
Bug | SPIREPDF-7133 | Fixes the issue that the result of signature validity verification was incorrect. |
Bug | SPIREPDF-7144 | Fixes the issue that the result of bookmark style modification was incorrect. |
Bug | SPIREPDF-7148 | Optimizes the time consumption of PDF to image conversion. |
Python: Remove Backgrounds from PowerPoint Slide or Slide Masters
A well-chosen background can enhance a presentation's appeal, but overly elaborate colors or images may distract viewers and obscure the main message. Additionally, when reusing templates, the original background may not suit the new content. In these cases, removing the background becomes essential to keep your slides clear and focused. This article will show you how to remove backgrounds from PowerPoint slides or slide masters in Python with Spire.Presentation for Python, giving you the flexibility to create clean, professional presentations that keep the audience's attention on what matters.
- Remove Backgrounds from the Specified Slide
- Remove Backgrounds from All Slides
- Remove Backgrounds from PowerPoint Slide Masters
Install Spire.Presentation for Python
This scenario requires Spire.Presentation for Python and plum-dispatch v1.7.4. They can be easily installed in your Windows through the following pip command.
pip install Spire.Presentation
If you are unsure how to install, please refer to this tutorial: How to Install Spire.Presentation for Python on Windows
Remove Backgrounds from the Specified Slide
There are typically two types of backgrounds in PowerPoint: background colors and background images. Although these backgrounds differ in their setup, the method to clear them is the same - using the BackgroundType property provided by Spire.Presentation for Python. Let's take a closer look at how to remove backgrounds from a PowerPoint slide with it.
Steps to remove background from a specified slide:
- Create an object for the Presentation class.
- Load a PowerPoint presentation from the local storage using Presentation.LoadFromFile() method.
- Get a certain slide with Presentation.Slides[] method.
- Remove the background by configuring BackgroundType property to none.
- Save the modified PowerPoint presentation using Presentation.SaveToFile() method, and release the memory.
Here is the code example of removing the background on the fourth slide:
- Python
from spire.presentation import * # Create a Presentation document object presentation = Presentation() # Read the presentation document from file presentation.LoadFromFile("imagebackground.pptx") # Get the fourth slide slide = presentation.Slides[3] # Remove the background by setting the background type slide.SlideBackground.Type = BackgroundType.none # Save the modified presentation presentation.SaveToFile("RemoveBackground.pptx", FileFormat.Pptx2010) # Release resource presentation.Dispose()
Remove Backgrounds from All Slides
Batch-deleting all slide backgrounds follows nearly the same steps as deleting a single slide background. The main difference is that you'll need to loop through each slide before setting the background type to ensure no slides are missed.
Steps to remove backgrounds from PowerPoint slides in a batch:
- Instantiate a Presentation class.
- Specify the file path to read a PowerPoint presentation using Presentation.LoadFromFile() method.
- Loop through each slide in the presentation.
- Remove all backgournds by applying BackgroundType.none property to each slide.
- Save the updated PowerPoint presentation as a new file with Presentation.SaveToFile() method, and release the resource.
Below is the code example for removing each background from PowerPoint slides:
- Python
from spire.presentation import * # Create a Presentation document object presentation = Presentation() # Read the presentation document from file presentation.LoadFromFile("presentation.pptx") # Loop through each slide for slide in presentation.Slides: # Remove the background image or color by setting the background type slide.SlideBackground.Type = BackgroundType.none # Save the modified presentation presentation.SaveToFile("RemoveBackground_allSlides.pptx", FileFormat.Pptx2010) # Release resource presentation.Dispose()
How to Remove Backgrounds from PowerPoint Slide Masters
If the slide background still exists after using the above method, you may need to remove the slide master's background instead. Unlike individual slides, setting the background of a slide master applies changes across all slides, so removing the slide master background can efficiently clear all backgrounds at once.
Steps to remove backgrounds from PowerPoint slide masters:
- Create an instance of the Presentation class.
- Load a presentation from the disk with Presentation.LoadFromFile() method.
- Retrieve a specified slide master using Presentation.Masters[] method.
- Access the background of the slide master with Masters.SlideBackground property.
- Remove the background by setting BackgroundType property to none.
- Save the newly modified PowerPoint presentation with Presentation.SaveToFile() method.
Note: Since the process of batch-removing slide master backgrounds is almost similar to deleting background from a slide master, this section will show the steps in the code comments rather than listing them separately.
Here is an example of removing the background from the third slide master:
- Python
from spire.presentation import * # Create a Presentation object presentation = Presentation() # Load the sample file from the disk presentation.LoadFromFile("presentation.pptx") # Get the third slide master master = presentation.Masters[2] # Access the background of the slide master SlideBackground = master.SlideBackground # Clear the background by setting the slide master background style to none master.SlideBackground.Type = BackgroundType.none # Loop through each slide master #for master in presentation.Masters: # Set the background type to none to remove it #master.SlideBackground.Type = BackgroundType.none # Save the result presentation presentation.SaveToFile("remove_background.pptx", FileFormat.Pptx2013) # Release resources presentation.Dispose()
Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.
Spire.Doc for Java 12.11.0 optimizes the conversions from Word to PDF and HTML
We're pleased to announce the release of Spire.Doc for Java 12.11.0. This version optimizes the conversions from Word to PDF, HTML, as well as RTF to PDF, and also fixes some issues that occurred when loading and saving Word files. More details are listed below.
Here is a list of changes made in this release
Category | ID | Description |
Bug | SPIREDOC-10693 | Fixes the issue that the highlighting effect was incorrect when searching. |
Bug | SPIREDOC-10726 | Fixes the issue that the table borders were not displaying in WPS after saving doc as docx. |
Bug | SPIREDOC-10747 | Fixes the issue that the program threw an "IllegalArgumentException" when converting Word to PDF. |
Bug | SPIREDOC-10755 | Fixes the issue that the border properties of the table changed. |
Bug | SPIREDOC-10794 | Fixes the issue that the column widths in tables were inconsistent after converting Word to HTML. |
Bug | SPIREDOC-10833 | Fixes the issue that the program threw an "Unexpected table container" error when converting Word to PDF. |
Bug | SPIREDOC-10861 | Fixes the issue that the layout was inconsistent when converting Word to HTML. |
Bug | SPIREDOC-10862 | Fixes the issue that the images were lost when converting RTF to PDF. |
Bug | SPIREDOC-10864 | Fixed the issue of incorrect effect after accept the revisions. |
Bug | SPIREDOC-10868 | Fixes the issue that the program threw the error "The string contains invalid characters" when loading Word. |
Bug | SPIREDOC-10822 | Fixed the issue of incorrect effect when adding LaTeX formula. |
Spire.XLS for Java 14.11.0 enhances the conversion from Excel to PDF
We are excited to announce the release of Spire.XLS for Java 14.11.0. The latest version enhances the conversion from Excel to PDF. Besides, some known bugs are fixed successfully in this update, such as the issue that font sizes were inconsistent after saving some Excel files. More details are listed below.
Here is a list of changes made in this release
Category | ID | Description |
Bug | SPIREXLS-5446 | Fixes the issue that the program threw "Specified argument was out of the range of valid values" when converting XLSX to XLSB. |
Bug | SPIREXLS-5493 | Fixes the issue that incorrect effect occurred when using Worksheet.autoFitColumn. |
Bug | SPIREXLS-5516 | Fixes the issue that content got lost when converting Excel to PDF. |
Bug | SPIREXLS-5526 | Fixes the issue that font sizes were inconsistent after saving some Excel files. |