In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "the process of Java adding text boxes to PPT slides". In daily operation, I believe that many people have doubts about the process of adding text boxes to PPT slides in Java. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "Java adding text boxes to PPT slides". Next, please follow the editor to study!
Jar file acquisition and import:
Method 1: download the jar package through the E-iceblue official website. After downloading, extract the file and import the Spire.Presentation.jar file under the lib folder into the java program.
Method 2: it can be installed and imported through maven warehouse. Please refer to the import method.
Java code example (for reference)
Import com.spire.presentation.*;import com.spire.presentation.drawing.FillFormatType;import com.spire.presentation.drawing.GradientShapeType;import com.spire.presentation.drawing.OuterShadowEffect;import java.awt.*;public class AddTextBox {public static void main (String [] args) throws Exception {/ / create document Presentation ppt = new Presentation () / / get the first slide and add a rectangular text box IAutoShape tb = ppt.getSlides (). Get (0). GetShapes (). AppendShape (ShapeType.RECTANGLE,new Rectangle (80,120,550,200)); / / set the text box border style tb.getLine (). SetFillType (FillFormatType.SOLID); tb.getLine (). SetWidth (2.5); tb.getLine (). GetSolidFillColor (). SetColor (Color.white) / / add text to the text box and format the text tb.appendTextFrame ("add text box\ n Append Textbox"); PortionEx textRange = tb.getTextFrame () .getTextRange (); textRange.getFill () .setFillType (FillFormatType.SOLID); textRange.getFill () .getSolidColor () .setColor (Color.white); textRange.setFontHeight (30); textRange.setLatinFont (new TextFont ("Arial Unicode MS")) / / the color of the filled text box is graded tb.getFill (). SetFillType (FillFormatType.GRADIENT); tb.getFill (). GetGradient (). SetGradientShape (GradientShapeType.LINEAR); tb.getFill (). GetGradient (). GetGradientStops (). Append (1f. GetGradient. Thistle); tb.getFill (). GetGradient (). GetGradientStops (). Append (0fMin KnownColors.ROYALLOBLUE); / set text box shadow effect OuterShadowEffect shadowEffect= new OuterShadowEffect (); shadowEffect.setBlurRadius (20) ShadowEffect.setDirection (30); shadowEffect.setDistance (8); shadowEffect.getColorFormat (). SetColor (Color.LIGHT_GRAY); tb.getEffectDag (). SetOuterShadowEffect (shadowEffect); / / set the text box to rotate 5 degrees to the right (a negative value to the left) tb.setRotation (5); / / Save the document ppt.saveToFile ("AddTextBox.pptx", FileFormat.PPTX_2013); ppt.dispose () }} at this point, the study on "the process of Java adding text boxes to PPT slides" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.