当前位置: 首页 > news >正文

做ppt的软件模板下载网站用微信小程序连接WordPress

做ppt的软件模板下载网站,用微信小程序连接WordPress,百度竞价怎么做效果好,推广网址1.什么是spire.doc? Spire.Doc for Java 是一款专业的 Java Word 组件#xff0c;开发人员使用它可以轻松地将 Word 文档创建、读取、编辑、转换和打印等功能集成到自己的 Java 应用程序中。作为一款完全独立的组件#xff0c;Spire.Doc for Java 的运行环境无需安装 Micro…1.什么是spire.doc? Spire.Doc for Java 是一款专业的 Java Word 组件开发人员使用它可以轻松地将 Word 文档创建、读取、编辑、转换和打印等功能集成到自己的 Java 应用程序中。作为一款完全独立的组件Spire.Doc for Java 的运行环境无需安装 Microsoft Office。同时兼容大部分国产操作系统能够在中标麒麟和中科方德等国产操作系统中正常运行。Spire.Doc for Java 支持 WPS 生成的 Word 格式文档.wps, .wpt。 Spire.Doc for Java 能执行多种 Word 文档处理任务包括生成、读取、转换和打印 Word 文档插入图片添加页眉和页脚创建表格添加表单域和邮件合并域添加书签添加文本和图片水印设置背景颜色和背景图片添加脚注和尾注添加超链接、数字签名加密和解密 Word 文档添加批注添加形状等。 2.代码工程 实验目的 实现创建wordword添加页读取word内容 pom.xml ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsdparentartifactIdspringboot-demo/artifactIdgroupIdcom.et/groupIdversion1.0-SNAPSHOT/version/parentmodelVersion4.0.0/modelVersionartifactIdspire-doc/artifactIdpropertiesmaven.compiler.source8/maven.compiler.sourcemaven.compiler.target8/maven.compiler.target/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-autoconfigure/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependencydependencygroupIde-iceblue/groupIdartifactIdspire.doc/artifactIdversion12.7.6/version/dependency/dependenciesrepositoriesrepositoryidcom.e-iceblue/idnamee-iceblue/nameurlhttps://repo.e-iceblue.com/nexus/content/groups/public//url/repository/repositories /project 创建word The following are the steps to create a simple Word document containing several paragraphs by using Spire.Doc for Java. Create a Document object.Add a section using Document.addSection() method.Set the page margins using Section.getPageSetup().setMargins() method.Add several paragraphs to the section using Section.addParagraph() method.Add text to the paragraphs using Paragraph.appendText() method.Create ParagraphStyle objects, and apply them to separate paragraphs using Paragraph.applyStyle() method.Save the document to a Word file using Document.saveToFile() method. package com.et.spire.doc;import com.spire.doc.Document; import com.spire.doc.FileFormat; import com.spire.doc.Section; import com.spire.doc.documents.HorizontalAlignment; import com.spire.doc.documents.Paragraph; import com.spire.doc.documents.ParagraphStyle;import java.awt.*;public class CreateWordDocument {public static void main(String[] args) {//Create a Document objectDocument doc new Document();//Add a sectionSection section doc.addSection();//Set the page marginssection.getPageSetup().getMargins().setAll(40f);//Add a paragraph as titleParagraph titleParagraph section.addParagraph();titleParagraph.appendText(Introduction of Spire.Doc for Java);//Add two paragraphs as bodyParagraph bodyParagraph_1 section.addParagraph();bodyParagraph_1.appendText(Spire.Doc for Java is a professional Word API that empowers Java applications to create, convert, manipulate and print Word documents without dependency on Microsoft Word.);Paragraph bodyParagraph_2 section.addParagraph();bodyParagraph_2.appendText(By using this multifunctional library, developers are able to process copious tasks effortlessly, such as inserting image, hyperlink, digital signature, bookmark and watermark, setting header and footer, creating table, setting background image, and adding footnote and endnote.);//Create and apply a style for title paragraphParagraphStyle style1 new ParagraphStyle(doc);style1.setName(titleStyle);style1.getCharacterFormat().setBold(true);;style1.getCharacterFormat().setTextColor(Color.BLUE);style1.getCharacterFormat().setFontName(Times New Roman);style1.getCharacterFormat().setFontSize(12f);doc.getStyles().add(style1);titleParagraph.applyStyle(titleStyle);//Create and apply a style for body paragraphsParagraphStyle style2 new ParagraphStyle(doc);style2.setName(paraStyle);style2.getCharacterFormat().setFontName(Times New Roman);style2.getCharacterFormat().setFontSize(12);doc.getStyles().add(style2);bodyParagraph_1.applyStyle(paraStyle);bodyParagraph_2.applyStyle(paraStyle);//Set the horizontal alignment of paragraphstitleParagraph.getFormat().setHorizontalAlignment(HorizontalAlignment.Center);bodyParagraph_1.getFormat().setHorizontalAlignment(HorizontalAlignment.Justify);bodyParagraph_2.getFormat().setHorizontalAlignment(HorizontalAlignment.Justify);//Set the first line indentbodyParagraph_1.getFormat().setFirstLineIndent(30) ;bodyParagraph_2.getFormat().setFirstLineIndent(30);//Set the after spacingtitleParagraph.getFormat().setAfterSpacing(10);bodyParagraph_1.getFormat().setAfterSpacing(10);//Save to filedoc.saveToFile(/Users/liuhaihua/tmp/WordDocument.docx, FileFormat.Docx_2013);doc.close();} } word添加新页 The steps to add a new page at the end of a Word document include locating the last section, and then inserting a page break at the end of that sections last paragraph. This way ensures that any content added subsequently will start displaying on a new page, maintaining the clarity and coherence of the document structure. The detailed steps are as follows: Create a Document object.Load a Word document using the Document.loadFromFile() method.Get the body of the last section of the document using Document.getLastSection().getBody().Add a page break by calling Paragraph.appendBreak(BreakType.Page_Break) method.Create a new paragraph style ParagraphStyle object.Add the new paragraph style to the documents style collection using Document.getStyles().add(paragraphStyle) method.Create a new paragraph Paragraph object and set the text content.Apply the previously created paragraph style to the new paragraph using Paragraph.applyStyle(paragraphStyle.getName()) method.Add the new paragraph to the document using Body.getChildObjects().add(paragraph) method.Save the resulting document using the Document.saveToFile() method. package com.et.spire.doc;import com.spire.doc.*; import com.spire.doc.documents.*;public class AddOnePage {public static void main(String[] args) {// Create a new document objectDocument document new Document();// Load a sample document from a filedocument.loadFromFile(/Users/liuhaihua/tmp/WordDocument.docx);// Get the body of the last section of the documentBody body document.getLastSection().getBody();// Insert a page break after the last paragraph in the bodybody.getLastParagraph().appendBreak(BreakType.Page_Break);// Create a new paragraph styleParagraphStyle paragraphStyle new ParagraphStyle(document);paragraphStyle.setName(CustomParagraphStyle1);paragraphStyle.getParagraphFormat().setLineSpacing(12);paragraphStyle.getParagraphFormat().setAfterSpacing(8);paragraphStyle.getCharacterFormat().setFontName(Microsoft YaHei);paragraphStyle.getCharacterFormat().setFontSize(12);// Add the paragraph style to the documents style collectiondocument.getStyles().add(paragraphStyle);// Create a new paragraph and set the text contentParagraph paragraph new Paragraph(document);paragraph.appendText(Thank you for using our Spire.Doc for Java product. The trial version will add a red watermark to the generated result document and only supports converting the first 10 pages to other formats. Upon purchasing and applying a license, these watermarks will be removed, and the functionality restrictions will be lifted.);// Apply the paragraph styleparagraph.applyStyle(paragraphStyle.getName());// Add the paragraph to the bodys content collectionbody.getChildObjects().add(paragraph);// Create another new paragraph and set the text contentparagraph new Paragraph(document);paragraph.appendText(To fully experience our product, we provide a one-month temporary license for each of our customers for free. Please send an email to salese-iceblue.com, and we will send the license to you within one working day.);// Apply the paragraph styleparagraph.applyStyle(paragraphStyle.getName());// Add the paragraph to the bodys content collectionbody.getChildObjects().add(paragraph);// Save the document to a specified pathdocument.saveToFile(/Users/liuhaihua/tmp/Add a Page.docx, FileFormat.Docx);// Close the documentdocument.close();// Dispose of the document objects resourcesdocument.dispose();} } 读取word内容 Using the FixedLayoutDocument class and FixedLayoutPage class makes it easy to extract content from a specified page. To facilitate viewing the extracted content, the following example code saves the extracted content to a new Word document. The detailed steps are as follows: Create a Document object.Load a Word document using the Document.loadFromFile() method.Create a FixedLayoutDocument object.Obtain a FixedLayoutPage object for a page in the document.Use the FixedLayoutPage.getSection() method to get the section where the page is located.Get the index position of the first paragraph on the page within the section.Get the index position of the last paragraph on the page within the section.Create another Document object.Add a new section using Document.addSection().Clone the properties of the original section to the new section using Section.cloneSectionPropertiesTo(newSection) method.Copy the content of the page from the original document to the new document.Save the resulting document using the Document.saveToFile() method. package com.et.spire.doc;import com.spire.doc.*; import com.spire.doc.pages.*; import com.spire.doc.documents.*;public class ReadOnePage {public static void main(String[] args) {// Create a new document objectDocument document new Document();// Load document content from the specified filedocument.loadFromFile(/Users/liuhaihua/tmp/WordDocument.docx);// Create a fixed layout document objectFixedLayoutDocument layoutDoc new FixedLayoutDocument(document);// Get the first pageFixedLayoutPage page layoutDoc.getPages().get(0);// Get the section where the page is locatedSection section page.getSection();// Get the first paragraph of the pageParagraph paragraphStart page.getColumns().get(0).getLines().getFirst().getParagraph();int startIndex 0;if (paragraphStart ! null) {// Get the index of the paragraph in the sectionstartIndex section.getBody().getChildObjects().indexOf(paragraphStart);}// Get the last paragraph of the pageParagraph paragraphEnd page.getColumns().get(0).getLines().getLast().getParagraph();int endIndex 0;if (paragraphEnd ! null) {// Get the index of the paragraph in the sectionendIndex section.getBody().getChildObjects().indexOf(paragraphEnd);}// Create a new document objectDocument newdoc new Document();// Add a new sectionSection newSection newdoc.addSection();// Clone the properties of the original section to the new sectionsection.cloneSectionPropertiesTo(newSection);// Copy the content of the original documents page to the new documentfor (int i startIndex; i endIndex; i){newSection.getBody().getChildObjects().add(section.getBody().getChildObjects().get(i).deepClone());}// Save the new document to the specified filenewdoc.saveToFile(/Users/liuhaihua/tmp/Content of One Page.docx, FileFormat.Docx);// Close and release the new documentnewdoc.close();newdoc.dispose();// Close and release the original documentdocument.close();document.dispose();} } 以上只是一些关键代码所有代码请参见下面代码仓库 代码仓库 https://github.com/Harries/springboot-demospire-doc 3.测试 运行上述java类的main方法会生成3个文件在对应的目录下 4.引用 Java: Create a Word DocumentSpring Boot集成Spire.doc实现对word的操作 | Harries Blog™
http://www.w-s-a.com/news/18319/

相关文章:

  • 网站建设需怎么做有网站怎么做企业邮箱
  • 网站制作流程视频教程小程序多少钱一年
  • 暗网是什么网站花都网站建设哪家好
  • 贵州网站开发流程晋江论坛手机版
  • 网站建设丿金手指谷哥14阿里巴巴官网电脑版
  • 网站开发招聘信息匿名ip访问网站受限
  • 网站转app工具网站规划建设与管理维护大作业
  • flash是怎么做网站的.net购物网站开发
  • 烟台网站建设求职简历品质商城网站建设
  • 做百度外链哪些网站权重高点做网站具备的条件
  • 怎么样用ppt做网站红番茄 网站点评
  • 建设银行河北分行招聘网站哪里能找到网站
  • 兰州营销型网站网站建设收费标准
  • 网站首页动图怎么做自己做网站很难
  • 自建网站如何盈利推广引流最快的方法
  • 网页设计网站结构图怎么弄网站用户 分析
  • 企业手机网站建设策划天津网页设计工作
  • 苏州vr全景网站建设公司怎么讲解网页的制作技术
  • 徐州智能建站怎么做苏州建设网站首页
  • 网站支付功能报价wordpress主页透明
  • asia域名的网站宁波模板建站源码
  • 官网网站怎么做个人网站盈利
  • 青龙桥网站建设网站同时做竞价和优化可以
  • 沭阳建设网站婴儿辅食中企动力提供网站建设
  • 常州做网站的公司济宁网站建设seo
  • 用wordpress做企业网站视频教程韶关建设网站
  • 怎么做一个免费的网站云南网站设计选哪家
  • dw做六个页面的网站做网站运营有前途吗
  • 中级网站开发工程师 试题战地之王网站做任务
  • 广东东莞保安公司湖南 seo