印章生成工具类开发

  1. Java代码见我的资源  免费使用印章生成工具类,Java开发-Java文档类资源-CSDN下载印章生成工具类,Java开发更多下载资源、学习资料请访问CSDN下载频道.https://download.csdn.net/download/jlonghou/85218149
  2. 代码:
    1. pom
      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.6.7</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com</groupId><artifactId>seal</artifactId><version>0.0.1-SNAPSHOT</version><name>seal</name><description>Demo project for Spring Boot</description><properties><java.version>1.8</java.version><maven.compiler.encoding>UTF-8</maven.compiler.encoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target></properties><repositories><repository><id>aliyun</id><name>aliyun</name><url>http://maven.aliyun.com/nexus/content/groups/public</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository></repositories><dependencies><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>RELEASE</version><scope>provided</scope></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>RELEASE</version><scope>test</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-test</artifactId><version>2.6.7</version><scope>test</scope></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><profiles><profile><id>jdk-1.8</id><activation><jdk>1.8</jdk></activation></profile></profiles></project>
      

      2.测试代码

      package com.seal;import org.junit.Before;
      import org.junit.jupiter.api.Test;
      import org.springframework.boot.test.context.SpringBootTest;import java.io.File;@SpringBootTest
      class SealApplicationTests {@Beforepublic void mkdir() {File dir = new File("src/main/resources/mg");if (!dir.exists()) {dir.mkdirs();}}@Testpublic void SealTest_1() throws Exception {Seal.builder().size(200).borderCircle(SealCircle.builder().line(4).width(95).height(95).build()).mainFont(SealFont.builder().text("中国公章开发有限公司").size(22).space(22.0).margin(4).build()).centerFont(SealFont.builder().text("★").size(60).build()).titleFont(SealFont.builder().text("电子签章").size(16).space(8.0).margin(54).build()).build().draw("src/main/resources/img/中国公章开发有限公司1.png");}@Testpublic void SealTest_2() throws Exception {Seal.builder().size(300).borderCircle(SealCircle.builder().line(5).width(140).height(140).build()).mainFont(SealFont.builder().text("中国公章开发有限公司").size(35).space(35.0).margin(10).build()).centerFont(SealFont.builder().text("★").size(100).build()).titleFont(SealFont.builder().text("电子签章").size(22).space(10.0).margin(68).build()).build().draw("src/main/resources/img/中国公章开发有限公司2.png");}@Testpublic void SealTest_3() throws Exception {Seal.builder().size(300).borderCircle(SealCircle.builder().line(3).width(144).height(100).build()).borderInnerCircle(SealCircle.builder().line(1).width(140).height(96).build()).mainFont(SealFont.builder().text("中国公章开发有限公司").size(25).space(12.0).margin(10).build()).centerFont(SealFont.builder().text("NO.5201314").size(20).build()).titleFont(SealFont.builder().text("电子合同专用章").size(20).space(9.0).margin(64).build()).build().draw("src/main/resources/img/中国公章开发有限公司3.png");}@Testpublic void SealTest_4() throws Exception {Seal.builder().size(300).borderSquare(16).mainFont(SealFont.builder().text("马卡").size(120).build()).build().draw("src/main/resources/img/马卡.png");}@Testpublic void SealTest_5() throws Exception {Seal.builder().size(300).borderSquare(16).mainFont(SealFont.builder().text("卡罗印").size(120).build()).build().draw("src/main/resources/img/卡罗.png");}
      }
      

      3.SealFont

      package com.seal;import lombok.Builder;
      import lombok.Getter;/*** @Author HOUJL* @Date 2022/4/25* @Description:*/
      @Getter
      @Builder
      public class SealFont {private String text;private String family;private Integer size;private Boolean bold;private Double space;private Integer margin;public String getFamily() {return family == null ? "宋体" : family;}public boolean getBold() {return bold == null ? true : bold;}public SealFont append(String text) {this.text += text;return this;}}
      

      4.SealCircle

      package com.seal;import lombok.Builder;
      import lombok.Getter;/*** @Author HOUJL* @Date 2022/4/25* @Description:*/
      @Getter
      @Builder
      public class SealCircle {private Integer line;private Integer width;private Integer height;
      }

      5.核心代码

      package com.seal;import lombok.Builder;
      import lombok.Getter;import javax.imageio.ImageIO;
      import java.awt.*;
      import java.awt.font.FontRenderContext;
      import java.awt.geom.AffineTransform;
      import java.awt.geom.Rectangle2D;
      import java.awt.image.BufferedImage;
      import java.io.File;/*** @Author HOUJL* @Date 2022/4/25* @Description:*/
      @Builder
      @Getter
      public class Seal {// 起始位置private static final int INIT_BEGIN = 5;// 尺寸private Integer size;// 颜色private Color color;// 主字private SealFont mainFont;// 副字private SealFont viceFont;// 抬头private SealFont titleFont;// 中心字private SealFont centerFont;// 边线圆private SealCircle borderCircle;// 内边线圆private SealCircle borderInnerCircle;// 内线圆private SealCircle innerCircle;// 边线框private Integer borderSquare;// 加字private String stamp;/*** 画公章*/public boolean draw(String pngPath) throws Exception {if (borderSquare != null) {return draw2(pngPath); // 画私章}//1.画布BufferedImage bi = new BufferedImage(size, size, BufferedImage.TYPE_4BYTE_ABGR);//2.画笔Graphics2D g2d = bi.createGraphics();//2.1抗锯齿设置//文本不抗锯齿,否则圆中心的文字会被拉长RenderingHints hints = new RenderingHints(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);//其他图形抗锯齿hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);g2d.setRenderingHints(hints);//2.2设置背景透明度g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 0));//2.3填充矩形g2d.fillRect(0, 0, size, size);//2.4重设透明度,开始画图g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC, 1));//2.5设置画笔颜色g2d.setPaint(color == null ? Color.RED : color);//3.画边线圆if (borderCircle != null) {drawCircle(g2d, borderCircle, INIT_BEGIN, INIT_BEGIN);} else {throw new Exception("BorderCircle can not null!");}int borderCircleWidth = borderCircle.getWidth();int borderCircleHeight = borderCircle.getHeight();//4.画内边线圆if (borderInnerCircle != null) {int x = INIT_BEGIN + borderCircleWidth - borderInnerCircle.getWidth();int y = INIT_BEGIN + borderCircleHeight - borderInnerCircle.getHeight();drawCircle(g2d, borderInnerCircle, x, y);}//5.画内环线圆if (innerCircle != null) {int x = INIT_BEGIN + borderCircleWidth - innerCircle.getWidth();int y = INIT_BEGIN + borderCircleHeight - innerCircle.getHeight();drawCircle(g2d, innerCircle, x, y);}//6.画弧形主文字if (borderCircleHeight != borderCircleWidth) {drawArcFont4Oval(g2d, borderCircle, mainFont, true);} else {drawArcFont4Circle(g2d, borderCircleHeight, mainFont, true);}//7.画弧形副文字if (borderCircleHeight != borderCircleWidth) {drawArcFont4Oval(g2d, borderCircle, viceFont, false);} else {drawArcFont4Circle(g2d, borderCircleHeight, viceFont, false);}//8.画中心字drawFont(g2d, (borderCircleWidth + INIT_BEGIN) * 2, (borderCircleHeight + INIT_BEGIN) * 2, centerFont);//9.画抬头文字drawFont(g2d, (borderCircleWidth + INIT_BEGIN) * 2, (borderCircleHeight + INIT_BEGIN) * 2, titleFont);g2d.dispose();return ImageIO.write(bi, "PNG", new File(pngPath));}/*** 绘制圆弧形文字*/private static void drawArcFont4Circle(Graphics2D g2d, int circleRadius, SealFont font, boolean isTop) {if (font == null) {return;}//1.字体长度int textLen = font.getText().length();//2.字体大小,默认根据字体长度动态设定int size = font.getSize() == null ? (55 - textLen * 2) : font.getSize();//3.字体样式int style = font.getBold() ? Font.BOLD : Font.PLAIN;//4.构造字体Font f = new Font(font.getFamily(), style, size);FontRenderContext context = g2d.getFontRenderContext();Rectangle2D rectangle = f.getStringBounds(font.getText(), context);//5.文字之间间距,默认动态调整double space;if (font.getSpace() != null) {space = font.getSpace();} else {if (textLen == 1) {space = 0;} else {space = rectangle.getWidth() / (textLen - 1) * 0.9;}}//6.距离外圈距离int margin = font.getMargin() == null ? INIT_BEGIN : font.getMargin();//7.写字double newRadius = circleRadius + rectangle.getY() - margin;double radianPerInterval = 2 * Math.asin(space / (2 * newRadius));double fix = 0.04;if (isTop) {fix = 0.18;}double firstAngle;if (!isTop) {if (textLen % 2 == 1) {firstAngle = Math.PI + Math.PI / 2 - (textLen - 1) * radianPerInterval / 2.0 - fix;} else {firstAngle = Math.PI + Math.PI / 2 - ((textLen / 2.0 - 0.5) * radianPerInterval) - fix;}} else {if (textLen % 2 == 1) {firstAngle = (textLen - 1) * radianPerInterval / 2.0 + Math.PI / 2 + fix;} else {firstAngle = (textLen / 2.0 - 0.5) * radianPerInterval + Math.PI / 2 + fix;}}for (int i = 0; i < textLen; i++) {double theta;double thetaX;double thetaY;if (!isTop) {theta = firstAngle + i * radianPerInterval;thetaX = newRadius * Math.sin(Math.PI / 2 - theta);thetaY = newRadius * Math.cos(theta - Math.PI / 2);} else {theta = firstAngle - i * radianPerInterval;thetaX = newRadius * Math.sin(Math.PI / 2 - theta);thetaY = newRadius * Math.cos(theta - Math.PI / 2);}AffineTransform transform;if (!isTop) {transform = AffineTransform.getRotateInstance(Math.PI + Math.PI / 2 - theta);} else {transform = AffineTransform.getRotateInstance(Math.PI / 2 - theta + Math.toRadians(8));}Font f2 = f.deriveFont(transform);g2d.setFont(f2);g2d.drawString(font.getText().substring(i, i + 1), (float) (circleRadius + thetaX + INIT_BEGIN),(float) (circleRadius - thetaY + INIT_BEGIN));}}/*** 绘制椭圆弧形文字*/private static void drawArcFont4Oval(Graphics2D g2d, SealCircle sealCircle, SealFont font, boolean isTop) {if (font == null) {return;}float radiusX = sealCircle.getWidth();float radiusY = sealCircle.getHeight();float radiusWidth = radiusX + sealCircle.getLine();float radiusHeight = radiusY + sealCircle.getLine();//1.字体长度int textLen = font.getText().length();//2.字体大小,默认根据字体长度动态设定int size = font.getSize() == null ? 25 + (10 - textLen) / 2 : font.getSize();//3.字体样式int style = font.getBold() ? Font.BOLD : Font.PLAIN;//4.构造字体Font f = new Font(font.getFamily(), style, size);//5.总的角跨度double totalArcAng = font.getSpace() * textLen;//6.从边线向中心的移动因子float minRat = 0.90f;double startAngle = isTop ? -90f - totalArcAng / 2f : 90f - totalArcAng / 2f;double step = 0.5;int alCount = (int) Math.ceil(totalArcAng / step) + 1;double[] angleArr = new double[alCount];double[] arcLenArr = new double[alCount];int num = 0;double accArcLen = 0.0;angleArr[num] = startAngle;arcLenArr[num] = accArcLen;num++;double angR = startAngle * Math.PI / 180.0;double lastX = radiusX * Math.cos(angR) + radiusWidth;double lastY = radiusY * Math.sin(angR) + radiusHeight;for (double i = startAngle + step; num < alCount; i += step) {angR = i * Math.PI / 180.0;double x = radiusX * Math.cos(angR) + radiusWidth, y = radiusY * Math.sin(angR) + radiusHeight;accArcLen += Math.sqrt((lastX - x) * (lastX - x) + (lastY - y) * (lastY - y));angleArr[num] = i;arcLenArr[num] = accArcLen;lastX = x;lastY = y;num++;}double arcPer = accArcLen / textLen;for (int i = 0; i < textLen; i++) {double arcL = i * arcPer + arcPer / 2.0;double ang = 0.0;for (int p = 0; p < arcLenArr.length - 1; p++) {if (arcLenArr[p] <= arcL && arcL <= arcLenArr[p + 1]) {ang = (arcL >= ((arcLenArr[p] + arcLenArr[p + 1]) / 2.0)) ? angleArr[p + 1] : angleArr[p];break;}}angR = (ang * Math.PI / 180f);Float x = radiusX * (float) Math.cos(angR) + radiusWidth;Float y = radiusY * (float) Math.sin(angR) + radiusHeight;double qxang = Math.atan2(radiusY * Math.cos(angR), -radiusX * Math.sin(angR));double fxang = qxang + Math.PI / 2.0;int subIndex = isTop ? i : textLen - 1 - i;String c = font.getText().substring(subIndex, subIndex + 1);//获取文字高宽FontMetrics fm = sun.font.FontDesignMetrics.getMetrics(f);int w = fm.stringWidth(c), h = fm.getHeight();if (isTop) {x += h * minRat * (float) Math.cos(fxang);y += h * minRat * (float) Math.sin(fxang);x += -w / 2f * (float) Math.cos(qxang);y += -w / 2f * (float) Math.sin(qxang);} else {x += (h * minRat) * (float) Math.cos(fxang);y += (h * minRat) * (float) Math.sin(fxang);x += w / 2f * (float) Math.cos(qxang);y += w / 2f * (float) Math.sin(qxang);}// 旋转AffineTransform affineTransform = new AffineTransform();affineTransform.scale(0.8, 1);if (isTop) {affineTransform.rotate(Math.toRadians((fxang * 180.0 / Math.PI - 90)), 0, 0);} else {affineTransform.rotate(Math.toRadians((fxang * 180.0 / Math.PI + 180 - 90)), 0, 0);}Font f2 = f.deriveFont(affineTransform);g2d.setFont(f2);g2d.drawString(c, x.intValue() + INIT_BEGIN, y.intValue() + INIT_BEGIN);}}/*** 画文字*/private static void drawFont(Graphics2D g2d, int circleWidth, int circleHeight, SealFont font) {if (font == null) {return;}//1.字体长度int textLen = font.getText().length();//2.字体大小,默认根据字体长度动态设定int size = font.getSize() == null ? (55 - textLen * 2) : font.getSize();//3.字体样式int style = font.getBold() ? Font.BOLD : Font.PLAIN;//4.构造字体Font f = new Font(font.getFamily(), style, size);g2d.setFont(f);FontRenderContext context = g2d.getFontRenderContext();String[] fontTexts = font.getText().split("\n");if (fontTexts.length > 1) {int y = 0;for (String fontText : fontTexts) {y += Math.abs(f.getStringBounds(fontText, context).getHeight());}//5.设置上边距float margin = INIT_BEGIN + (float) (circleHeight / 2 - y / 2);for (String fontText : fontTexts) {Rectangle2D rectangle2D = f.getStringBounds(fontText, context);g2d.drawString(fontText, (float) (circleWidth / 2 - rectangle2D.getCenterX()), margin);margin += Math.abs(rectangle2D.getHeight());}} else {Rectangle2D rectangle2D = f.getStringBounds(font.getText(), context);//5.设置上边距,默认在中心float margin = font.getMargin() == null ?(float) (circleHeight / 2 - rectangle2D.getCenterY()) :(float) (circleHeight / 2 - rectangle2D.getCenterY()) + (float) font.getMargin();g2d.drawString(font.getText(), (float) (circleWidth / 2 - rectangle2D.getCenterX()), margin);}}/*** 画圆*/private static void drawCircle(Graphics2D g2d, SealCircle circle, int x, int y) {if (circle == null) {return;}//1.圆线条粗细默认是圆直径的1/35int lineSize = circle.getLine() == null ? circle.getHeight() * 2 / (35) : circle.getLine();//2.画圆g2d.setStroke(new BasicStroke(lineSize));g2d.drawOval(x, y, circle.getWidth() * 2, circle.getHeight() * 2);}/*** 画私章*/public boolean draw2(String pngPath) throws Exception {if (mainFont == null || mainFont.getText().length() < 2 || mainFont.getText().length() > 4) {throw new IllegalArgumentException("请输入2-4个字");}int fixH = 18;int fixW = 2;//1.画布BufferedImage bi = new BufferedImage(size, size / 2, BufferedImage.TYPE_4BYTE_ABGR);//2.画笔Graphics2D g2d = bi.createGraphics();//2.1设置画笔颜色g2d.setPaint(Color.RED);//2.2抗锯齿设置g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);//3.写签名int marginW = fixW + borderSquare;float marginH;FontRenderContext context = g2d.getFontRenderContext();Rectangle2D rectangle;Font f;if (mainFont.getText().length() == 2) {if (stamp != null && stamp.trim().length() > 0) {bi = drawThreeFont(bi, g2d, mainFont.append(stamp), borderSquare, size, fixH, fixW, true);} else {f = new Font(mainFont.getFamily(), Font.BOLD, mainFont.getSize());g2d.setFont(f);rectangle = f.getStringBounds(mainFont.getText().substring(0, 1), context);marginH = (float) (Math.abs(rectangle.getCenterY()) * 2 + marginW) + fixH - 4;g2d.drawString(mainFont.getText().substring(0, 1), marginW, marginH);marginW += Math.abs(rectangle.getCenterX()) * 2 + (mainFont.getSpace() == null ? INIT_BEGIN : mainFont.getSpace());g2d.drawString(mainFont.getText().substring(1), marginW, marginH);//拉伸BufferedImage nbi = new BufferedImage(size, size, bi.getType());Graphics2D ng2d = nbi.createGraphics();ng2d.setPaint(Color.RED);ng2d.drawImage(bi, 0, 0, size, size, null);//画正方形ng2d.setStroke(new BasicStroke(borderSquare));ng2d.drawRect(0, 0, size, size);ng2d.dispose();bi = nbi;}} else if (mainFont.getText().length() == 3) {if (stamp != null && stamp.trim().length() > 0) {bi = drawFourFont(bi, mainFont.append(stamp), borderSquare, size, fixH, fixW);} else {bi = drawThreeFont(bi, g2d, mainFont, borderSquare, size, fixH, fixW, false);}} else {bi = drawFourFont(bi, mainFont, borderSquare, size, fixH, fixW);}g2d.dispose();return ImageIO.write(bi, "PNG", new File(pngPath));}/*** 画三字*/private static BufferedImage drawThreeFont(BufferedImage bi, Graphics2D g2d, SealFont font, int lineSize, int imageSize, int fixH,int fixW, boolean isWithYin) {fixH -= 9;int marginW = fixW + lineSize;//设置字体Font f = new Font(font.getFamily(), Font.BOLD, font.getSize());g2d.setFont(f);FontRenderContext context = g2d.getFontRenderContext();Rectangle2D rectangle = f.getStringBounds(font.getText().substring(0, 1), context);float marginH = (float) (Math.abs(rectangle.getCenterY()) * 2 + marginW) + fixH;int oldW = marginW;if (isWithYin) {g2d.drawString(font.getText().substring(2, 3), marginW, marginH);marginW += rectangle.getCenterX() * 2 + (font.getSpace() == null ? INIT_BEGIN : font.getSpace());} else {marginW += rectangle.getCenterX() * 2 + (font.getSpace() == null ? INIT_BEGIN : font.getSpace());g2d.drawString(font.getText().substring(0, 1), marginW, marginH);}//拉伸BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());Graphics2D ng2d = nbi.createGraphics();ng2d.setPaint(Color.RED);ng2d.drawImage(bi, 0, 0, imageSize, imageSize, null);//画正方形ng2d.setStroke(new BasicStroke(lineSize));ng2d.drawRect(0, 0, imageSize, imageSize);ng2d.dispose();bi = nbi;g2d = bi.createGraphics();g2d.setPaint(Color.RED);g2d.setFont(f);g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);if (isWithYin) {g2d.drawString(font.getText().substring(0, 1), marginW, marginH += fixH);rectangle = f.getStringBounds(font.getText(), context);marginH += Math.abs(rectangle.getHeight());g2d.drawString(font.getText().substring(1), marginW, marginH);} else {g2d.drawString(font.getText().substring(1, 2), oldW, marginH += fixH);rectangle = f.getStringBounds(font.getText(), context);marginH += Math.abs(rectangle.getHeight());g2d.drawString(font.getText().substring(2, 3), oldW, marginH);}return bi;}/*** 画四字*/private static BufferedImage drawFourFont(BufferedImage bi, SealFont font, int lineSize, int imageSize, int fixH, int fixW) {int marginW = fixW + lineSize;//拉伸BufferedImage nbi = new BufferedImage(imageSize, imageSize, bi.getType());Graphics2D ng2d = nbi.createGraphics();ng2d.setPaint(Color.RED);ng2d.drawImage(bi, 0, 0, imageSize, imageSize, null);//画正方形ng2d.setStroke(new BasicStroke(lineSize));ng2d.drawRect(0, 0, imageSize, imageSize);ng2d.dispose();bi = nbi;Graphics2D g2d = bi.createGraphics();g2d.setPaint(Color.RED);g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);FontRenderContext context = g2d.getFontRenderContext();Font f = new Font(font.getFamily(), Font.BOLD, font.getSize());g2d.setFont(f);Rectangle2D rectangle = f.getStringBounds(font.getText().substring(0, 1), context);float marginH = (float) (Math.abs(rectangle.getCenterY()) * 2 + marginW) + fixH;g2d.drawString(font.getText().substring(2, 3), marginW, marginH);int oldW = marginW;marginW += Math.abs(rectangle.getCenterX()) * 2 + (font.getSpace() == null ? INIT_BEGIN : font.getSpace());g2d.drawString(font.getText().substring(0, 1), marginW, marginH);marginH += Math.abs(rectangle.getHeight());g2d.drawString(font.getText().substring(3, 4), oldW, marginH);g2d.drawString(font.getText().substring(1, 2), marginW, marginH);return bi;}
      }
      

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/45605.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

鲁祥老师吉他课学习笔记

鲁祥老师吉他课学习笔记 导语 参考教材&#xff1a; 《吉他入门经典教程》李国标 《弹指之间》潘尚文 《吉他教本》好连得出版社 《吉他教程》杰瑞吉他学校 《伯克利现代吉他教程》 《吉他考级教程》英国RSL其中的原声吉他和电吉他教程 《一个月电吉他新手养成计划》宫胁俊郎 …

谋定菲律宾农业全产业链建设 对话国际农民丰收节贸易会

谋定菲律宾农业全产业链建设 对话国际农民丰收节贸易会 新闻中国采编网 中国新闻采编网 谋定研究中国智库网 经信研究 国研智库 国情讲坛 哲商对话 万权采编&#xff1a;应菲律宾驻中国大使馆商务参赞格伦.佩尼亚兰达邀请&#xff0c;AIF亚投联代表团同菲律宾BOI在菲律宾马卡提…

因果解释能够对规则进行解释吗?

来源&#xff1a;《哲学动态》2017年第10期作者&#xff1a;初维峰&#xff08;西安交通大学人文社会科学学院&#xff09; 本文受中国博士后科学基金面上资助项目“当代西方因果解释理论研究”(2017M613160)资助。 在现实生活中&#xff0c;我们不仅要对某一事件进行解释&…

Cocos技术派 | 3d人物渲染详细教程

文章目录 前言3d系统基础FBX模型导入配置模型参数相机分组2D相机设置添加UI节点添加3D节点设置灯光设置平台接收阴影设置3D相机3D场景编辑器设置模型材质设置模型产生阴影设置相机位置播放动画增加3D动作 本文假设你是一个新手&#xff0c;按照本文的操作&#xff0c;可以跑起来…

xmas cissp_Sourcehunt PHP Xmas 2015:发出请求请求的礼物!

xmas cissp Before we round the year up, there’s one more issue of Sourcehunt to publish, as a small Xmas gift to all the underrepresented open source projects out there. Let’s get everyone some more contributors, shall we? 在整年之前&#xff0c;还有一期…

在计算机上写一封邮件的英文,一封邮件英文怎么写

1. 用英语写的一封电子邮件 Dear David, Hello, Its very gald to recive your e-mail.You told me you will come to China to study.Its great!I think you must want to know how to learn Chinese well.OK,let me tell you.First,you should listen to teachers carefully.…

几种常用英文信件范文

几种常用英文信件范文 1&#xff09;感谢信Letter of thanks 2&#xff09;祝贺信 Letter of greetings 3&#xff09;邀请信 Letter of invitations 4&#xff09;一般信件 Common letters 5&#xff09;商业信件 Business letters 6&#xff09;求学信 Letters of Applying…

python自动发送邮件自定义邮件发件人和收件人的显示内容

#自定义处理邮件收发地址的显示内容 def _format_addr(s): name,addr parseaddr(s) print name print addr #将邮件的name转换成utf-8格式&#xff0c;addr如果是unicode&#xff0c;则转换utf-8输出&#xff0c;否则直接输出addr return formataddr((\ Header(name,utf-8).en…

用python实现邮件的自动发送

首先开启自己的邮箱SMTP服务&#xff08;绑定自己的手机&#xff0c;但记住密码不要泄露&#xff0c;防止别人拿自己邮箱发送别的内容&#xff09; 这里我们拿163邮箱举例&#xff1a;Smtp服务器地址 和 端口 Ssl&#xff1a; smtp.163.com&#xff1a;465 非ssl &#xff1a…

使用qq邮箱作为程序客户端自动发送邮件

在用户一些软件或自己的java程序是&#xff0c;需要配置发送邮件 这里的发送人就填写具体的qq邮箱&#xff0c;但是下面的smtp密码就不是对应的qq密码了&#xff0c;这里需要的是授权码。我们需要去qq邮箱申请开启”IMAP/SMTP服务” 如何使用IMAP服务&#xff1f; IMAP是什么…

【原创】PHP 邮件自动发送(QQ邮箱)

本文所有教程及源码、软件仅为技术研究。不涉及计算机信息系统功能的删除、修改、增加、干扰,更不会影响计算机信息系统的正常运行。不得将代码用于非法用途,如侵立删!环境 win10phpstrom2020.1PHP 7.0QQ邮箱开通SMTP服务 1.登录 QQ 邮箱 2.开启 SMTP 服务 3.发送短信

控制飞书客户端自动发邮件

自动化飞书邮箱网页版应该有不少例子&#xff0c;可以使用Clicknium、Selenium&#xff0c;Playwright这些工具实现。这次使用[Clicknium](https://www.clicknium.com/)来介绍一下桌面客户端的自动化&#xff0c;进一步讲解如果利用Python实现桌面端自动化。想要写一个能稳定运…

利用Python自动发送邮件

自动发送邮件 我们把报表做出来以后一般都是需要发给别人查看&#xff0c;对于一些每天需要发的报表或者是需要一次发送多份的报表&#xff0c;这个时候可以考虑借助Python来自动发送邮件。 使用邮箱的第一步 一般我们在使用QQ邮箱、163邮箱、126邮箱等这些比较常用的邮箱时…

Python实现自动写邮件

Python实现自动写邮件 上星期接到任务要完成一个自动写邮件的脚本&#xff0c;基本功能是每两小时执行一次程序跑出统计表格&#xff0c;并将统计表格的summary发送到领导的邮箱。由于公司是做数字货币的&#xff0c;每两小时实时监测策略交易情况较为必要。下面来实现自动写邮…

day06 代码实现邮件自动发送

目录 一. 邮件发送基本流程二. 添加文件附件三. 发送富文本四. 发送图片五. 认识前端HTML ————————— 获取邮箱授权码————————— 一. 邮件发送基本流程 生活中发送邮件的步骤&#xff1a; 注册邮箱信息 —> 打开登录邮箱的网址 —> 输入账号密码完成登录…

Python实现自动发送邮件 - 自动抓取Blog中留言的邮箱并发送邮件

Python实现自动发送邮件 - 自动抓取博客/网站中留言的邮箱并发送邮件 背景脚本要解决的问题&#xff1a;实现方法代码及解析1. AutoSendEmailByBlogComments.py2. FileOperation.py3. SendEmail.py 备注&#xff1a;邮箱SMTP设置其它好玩的Python脚本 博主热门文章推荐&#xf…

python自动发送邮件实现

目录 1 前言2 准备工作2.1 电子邮件的基础知识。2.2 python邮件库2.3 邮箱设置 3 python实现邮件自动发送3.1 SMTP()和send()方法介绍3.2 python实现实例 参考信息 1 前言 python功能强大&#xff0c;可以实现我们日常办公的很多任务。诸如批量处理word,excel,pdf等等文件&…

VBA使用Outlook自动发送邮件

↓↓↓欢迎关注我的公众号&#xff0c;在这里有数据相关技术经验的优质原创文章↓↓↓ 基础版本–能自动发送就是成功 利用VBA使用Outlook自动发送邮件&#xff0c;代码及注释如下&#xff1a; Sub send_mail()Dim ObjOL As Object Dim itmNewMail As Outlook.MailItem Dim…

Python实现自动发送邮件

最近比较闲的慌&#xff0c;在自己学习Python爬虫&#xff0c;学到了用Python发送邮件&#xff0c;觉得这个可能以后比较实用。以下项目用QQ邮箱为例。 需要用到的模块&#xff1a; smtplib&#xff0c;email 提醒&#xff01;QQ 邮箱一般默认关闭SMTP服务&#xff0c;我们得…

chatgpt赋能python:Python写模拟器脚本

Python写模拟器脚本 Python是一种强大的编程语言&#xff0c;适用于各种任务&#xff0c;包括模拟器编写。模拟器是一种软件程序&#xff0c;能够模拟硬件或软件系统的行为。这篇文章将介绍Python编写模拟器脚本时需要关注的一些关键点。 为什么选择Python编写模拟器脚本 Py…