itext5和itext7操作pdf平铺和图层叠加(tiling, and N-upping)
区别
itext5 生成pdf版本:1.4(Acrobat5.x)
itext7 生成pdf版本:1.7(Acrobat8.x)
iText7生成的pdf文件大, itext7 Java库更加系统和完善
iText测试版本和功能描述
itext5
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13</version>
</dependency>
itext7
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext7-core</artifactId>
<version>7.1.8</version>
<type>pom</type>
</dependency>
描述: pdf稿件平铺和生成条形码
示例代码
itext5
package com.demo.controller;
import com.itextpdf.text.*;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.*;
import java.io.FileOutputStream;
import java.io.IOException;
import com.itextpdf.text.Document;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfImportedPage;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfWriter;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class HelloController {
public static final String OUTDIR = "results/big/";
private float _PT_CM_RATE = 0.352736F;
private static float _PILLOW_HEIGHT = 70F / 0.352736F;
private static float _PILLOW_WIDTH = 47F / 0.352736F;
public static void main(String args[]) throws IOException {
File file = new File(OUTDIR);
file.getParentFile().mkdirs();
try {
double random = Math.random();
new HelloController().createCodePdf(OUTDIR+"all"+random+".pdf");
new HelloController().createRowPdf(OUTDIR+"row"+random+".pdf");
}catch (Exception e)
{
System.out.println(e.getMessage());
}
}
public void createCodePdf(String dest) throws IOException, DocumentException {
List<String> arrayList = new ArrayList<String>();
arrayList.add("results/test_three_01.pdf");
arrayList.add("results/test_three_02.pdf");
arrayList.add("results/test_three_03.pdf");
arrayList.add("results/test_three_04.pdf");
arrayList.add("results/test_three_05.pdf");
arrayList.add("results/test_three_06.pdf");
arrayList.add("results/test_three_07.pdf");
arrayList.add("results/test_three_08.pdf");
arrayList.add("results/test_three_09.pdf");
arrayList.add("results/test_three_10.pdf");
//生成文件的pdfDoc对象
Document document = new Document(new Rectangle(707 / _PT_CM_RATE, 1081 / _PT_CM_RATE));
PdfWriter pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(dest));
document.open();
PdfContentByte canvas = pdfWriter.getDirectContent();
//1.添加两边黑光标
PdfReader pdfBlack = new PdfReader("results/black_47.pdf");
Rectangle pageSize = pdfBlack.getPageSize(1);
final float pdfBlackWidth = pageSize.getWidth();
PdfImportedPage pageBlackCopy = pdfWriter.getImportedPage(pdfBlack, 1);
int rowWorkNum = 18;
int rowCodeNum = 5;
//2.遍历稿件list
for (int i = 1; i <= rowWorkNum+rowCodeNum; i++)
{
canvas.addTemplate(pageBlackCopy, 0, _PILLOW_WIDTH*(i-1) );
canvas.addTemplate(pageBlackCopy,_PILLOW_HEIGHT*10+pdfBlackWidth,_PILLOW_WIDTH*(i-1));
}
int j = 0;
PdfImportedPage workPdfPage;
for (String work : arrayList) {
//读取稿件内容
PdfReader workPdf = new PdfReader(work);
workPdfPage = pdfWriter.getImportedPage(workPdf, 1);
for (int i = 1; i <= rowWorkNum; i++) {
canvas.addTemplate(workPdfPage, 0, -1, 1, 0, _PILLOW_HEIGHT * j + pdfBlackWidth, _PILLOW_WIDTH * (i + 5));
}
j++;
}
//3.遍历条形码
//遍历条形码底图
PdfReader pdfBlackCode = new PdfReader("results/black_100.pdf");
PdfImportedPage pageBlackCodeCopy = pdfWriter.getImportedPage(pdfBlackCode, 1);
for(int jj=1; jj<=10; jj++){
Barcode128 barcode = new Barcode128();
barcode.setCodeType(Barcode.CODE128);
barcode.setBarHeight(14);
barcode.setX(0.4F);
barcode.setBaseline(23f);
barcode.setCode("1954745454544_3-"+jj);
barcode.setTextAlignment(0);
PdfTemplate templateWithBarcode = barcode.createTemplateWithBarcode(canvas, BaseColor.BLACK, BaseColor.BLACK);
barcode.setFont(BaseFont.createFont("c:/windows/fonts/simkai.ttf", BaseFont.IDENTITY_H,false));
barcode.setAltText("进口量煎熬副科级第三方");
PdfTemplate templateWithBarcodeText = barcode.createTemplateWithBarcode(canvas, BaseColor.BLACK, BaseColor.BLACK);
barcode.setAltText("");
PdfTemplate templateWithBarcodeNone = barcode.createTemplateWithBarcode(canvas, BaseColor.BLACK, BaseColor.BLACK);
for(int i=1; i<=rowCodeNum; i++){
canvas.addTemplate(pageBlackCodeCopy,0,-1,1,0,(jj-1)*_PILLOW_HEIGHT+pdfBlackWidth,(i)*_PILLOW_WIDTH);
canvas.addTemplate(templateWithBarcodeText, 0, -1, 1, 0, 52 + (jj - 1) * _PILLOW_HEIGHT + pdfBlackWidth, (i) * _PILLOW_WIDTH - 25);
canvas.addTemplate(templateWithBarcode, 0, -1, 1, 0, 67 + (jj - 1) * _PILLOW_HEIGHT + pdfBlackWidth, (i) * _PILLOW_WIDTH - 25);
canvas.addTemplate(templateWithBarcodeNone, 0, -1, 1, 0, 82 + (jj - 1) * _PILLOW_HEIGHT + pdfBlackWidth, (i) * _PILLOW_WIDTH - 25);
canvas.addTemplate(templateWithBarcodeNone, 0, -1, 1, 0, 97 + (jj - 1) * _PILLOW_HEIGHT + pdfBlackWidth, (i) * _PILLOW_WIDTH - 25);
}
}
//4.关闭资源
document.close();
pdfBlack.close();
pdfBlackCode.close();
}
public void createRowPdf(String dest) throws IOException , DocumentException{
List<String> arrayList = new ArrayList<String>();
arrayList.add("results/test_three_01.pdf");
arrayList.add("results/test_three_02.pdf");
arrayList.add("results/test_three_03.pdf");
arrayList.add("results/test_three_04.pdf");
arrayList.add("results/test_three_05.pdf");
arrayList.add("results/test_three_06.pdf");
arrayList.add("results/test_three_07.pdf");
arrayList.add("results/test_three_08.pdf");
arrayList.add("results/test_three_09.pdf");
arrayList.add("results/test_three_10.pdf");
//生成文件的pdfDoc对象
Document document = new Document(new Rectangle(707 / _PT_CM_RATE, 47/ _PT_CM_RATE));
PdfWriter pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(dest));
document.open();
PdfContentByte canvas = pdfWriter.getDirectContent();
//1.添加两边黑光标
PdfReader pdfBlack = new PdfReader("results/black_47.pdf");
Rectangle pageSize = pdfBlack.getPageSize(1);
final float pdfBlackWidth = pageSize.getWidth();
PdfImportedPage pageBlackCopy = pdfWriter.getImportedPage(pdfBlack, 1);
int rowWorkNum = 1;
int rowCodeNum = 0;
//2.遍历稿件list
for (int i = 1; i <= rowWorkNum+rowCodeNum; i++)
{
canvas.addTemplate(pageBlackCopy, 0, _PILLOW_WIDTH*(i-1) );
canvas.addTemplate(pageBlackCopy,_PILLOW_HEIGHT*10+pdfBlackWidth,_PILLOW_WIDTH*(i-1));
}
int j = 0;
PdfImportedPage workPdfPage;
for (String work : arrayList) {
//读取稿件内容
PdfReader workPdf = new PdfReader(work);
workPdfPage = pdfWriter.getImportedPage(workPdf, 1);
for (int i = 1; i <= rowWorkNum; i++) {
canvas.addTemplate(workPdfPage, 0, -1, 1, 0, _PILLOW_HEIGHT * j + pdfBlackWidth, _PILLOW_WIDTH * (i));
}
j++;
}
//关闭资源
document.close();
pdfBlack.close();
}
}
itext7
package com.demo.controller;
import com.itextpdf.io.font.PdfEncodings;
import com.itextpdf.io.font.constants.StandardFonts;
import com.itextpdf.io.image.ImageDataFactory;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.font.PdfFontFactory;
import com.itextpdf.barcodes.Barcode128;
import com.itextpdf.barcodes.Barcode1D;
import com.itextpdf.io.font.FontConstants;
import com.itextpdf.io.image.ImageData;
import com.itextpdf.io.image.ImageType;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.PdfReader;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.kernel.pdf.xobject.PdfFormXObject;
import com.itextpdf.kernel.geom.AffineTransform;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.kernel.PdfException;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.colors.ColorConstants;
import com.itextpdf.kernel.colors.DeviceRgb;
import org.apache.pdfbox.cos.COSBase;
import org.apache.pdfbox.cos.COSDictionary;
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.itextpdf.layout.element.Text;
import static com.itextpdf.svg.SvgConstants.Tags.IMAGE;
public class HelloController {
public static final String DEST = "results/big/wwww"+Math.random()+".pdf";
private float _PT_CM_RATE = 0.352736F;
private static float _PILLOW_HEIGHT = 70F / 0.352736F;
private static float _PILLOW_WIDTH = 47F / 0.352736F;
public static void main(String args[]) throws IOException {
File file = new File(DEST);
file.getParentFile().mkdirs();
// new HelloController().createCodePdf(DEST);
new HelloController().createRowPdf(DEST);
}
public void createCodePdf(String dest) throws IOException {
List<String> arrayList = new ArrayList<String>();
arrayList.add("results/test_three_01.pdf");
arrayList.add("results/test_three_02.pdf");
arrayList.add("results/test_three_03.pdf");
arrayList.add("results/test_three_04.pdf");
arrayList.add("results/test_three_05.pdf");
arrayList.add("results/test_three_06.pdf");
arrayList.add("results/test_three_07.pdf");
arrayList.add("results/test_three_08.pdf");
arrayList.add("results/test_three_09.pdf");
arrayList.add("results/test_three_10.pdf");
//生成文件的pdfDoc对象
PdfWriter dfWriter = new PdfWriter(dest);
dfWriter.setSmartMode(true);
PdfDocument pdf = new PdfDocument(dfWriter);
PageSize nUpPageSize = new PageSize(707 / _PT_CM_RATE, 1081 / _PT_CM_RATE);
// PageSize nUpPageSize = new PageSize(707 / _PT_CM_RATE, 510 / _PT_CM_RATE);
PdfPage page = pdf.addNewPage(nUpPageSize);
//画布的生成
PdfCanvas canvas = new PdfCanvas(page);
//Scale page
AffineTransform transformationMatrix = AffineTransform.getScaleInstance(1, 1);
canvas.concatMatrix(transformationMatrix);//不旋转
//添加右侧黑光标
PdfDocument pdfBlack = new PdfDocument(new PdfReader("results/black_47.pdf"));
PdfPage blackPage = pdfBlack.getPage(1);
Rectangle origBlack = blackPage.getPageSize();
PdfFormXObject pageBlackCopy = blackPage.copyAsFormXObject(pdf);
int rowWorkNum = 18;
int rowCodeNum = 5;
//遍历稿件list
for (int i = 1; i <= rowWorkNum; i++)
canvas.addXObject(pageBlackCopy, 0, _PILLOW_WIDTH*(i+4) );
int j = 0;
for (String work : arrayList) {
//System.out.println(work);
//读取稿件内容
PdfDocument workPdf = new PdfDocument(new PdfReader(work));
PdfPage workPdfPage = workPdf.getPage(1);
PdfFormXObject workPdfPageForm = workPdfPage.copyAsFormXObject(pdf);
for (int i = 1; i <= rowWorkNum; i++) {
canvas.addXObject(workPdfPageForm, 0, -1, 1, 0, _PILLOW_HEIGHT * j + origBlack.getWidth(), _PILLOW_WIDTH * (i + 5));
}
workPdf.close();
j++;
}
for (int i = 1; i <= rowWorkNum; i++)
canvas.addXObject(pageBlackCopy,_PILLOW_HEIGHT*10+origBlack.getWidth(),_PILLOW_WIDTH*(i+4));
//遍历条形码
//遍历条形码底图
PdfDocument codeBackPdf = new PdfDocument(new PdfReader("results/black_100.pdf"));
PdfPage codeBackPage = codeBackPdf.getPage(1);
Rectangle codeBackPageRectangle = codeBackPage.getPageSize();
PdfFormXObject codeBackPageForm = codeBackPage.copyAsFormXObject(pdf);
for(int i=1; i<=rowCodeNum; i++){
canvas.addXObject(pageBlackCopy, 0, _PILLOW_WIDTH*(i-1) );
for(int jj=1; jj<=10; jj++){
canvas.addXObject(codeBackPageForm,0,-1,1,0,(jj-1)*_PILLOW_HEIGHT+origBlack.getWidth(),(i)*_PILLOW_WIDTH);
String myString = "1954745454544_3-1";
Barcode128 barcode = new Barcode128(pdf);
barcode.setCode(myString);
barcode.setCodeType(Barcode128.CODE128);
barcode.setBaseline(23f);
barcode.setAltText("进口量煎熬副科级第三方");
barcode.setFont(PdfFontFactory.createFont("c:/windows/fonts/simkai.ttf", PdfEncodings.IDENTITY_H,false));
barcode.setTextAlignment(Barcode1D.ALIGN_LEFT);
barcode.setBarHeight(14);
barcode.setX(0.45F);
PdfFormXObject pdfImg = barcode.createFormXObject(pdf);
barcode.setAltText("1954745454544_3-1");
PdfFormXObject pdfImgCode = barcode.createFormXObject(pdf);
barcode.setAltText("");
PdfFormXObject pdfImgOnly = barcode.createFormXObject(pdf);
//canvas.add(p);
canvas.addXObject(pdfImg,0,-1,1,0,52+(jj-1)*_PILLOW_HEIGHT+origBlack.getWidth(),(i)*_PILLOW_WIDTH-25);
canvas.addXObject(pdfImgCode,0,-1,1,0,67+(jj-1)*_PILLOW_HEIGHT+origBlack.getWidth(),(i)*_PILLOW_WIDTH-25);
canvas.addXObject(pdfImgOnly,0,-1,1,0,82+(jj-1)*_PILLOW_HEIGHT+origBlack.getWidth(),(i)*_PILLOW_WIDTH-25);
canvas.addXObject(pdfImgOnly,0,-1,1,0,97+(jj-1)*_PILLOW_HEIGHT+origBlack.getWidth(),(i)*_PILLOW_WIDTH-25);
}
canvas.addXObject(pageBlackCopy,_PILLOW_HEIGHT*10+origBlack.getWidth(),_PILLOW_WIDTH*(i-1));
}
pdfBlack.close();
pdf.close();
}
public void createRowPdf(String dest) throws IOException {
List<String> arrayList = new ArrayList<String>();
arrayList.add("results/test_three_01.pdf");
arrayList.add("results/test_three_02.pdf");
arrayList.add("results/test_three_03.pdf");
arrayList.add("results/test_three_04.pdf");
arrayList.add("results/test_three_05.pdf");
arrayList.add("results/test_three_06.pdf");
arrayList.add("results/test_three_07.pdf");
arrayList.add("results/test_three_08.pdf");
arrayList.add("results/test_three_09.pdf");
arrayList.add("results/test_three_10.pdf");
//生成文件的pdfDoc对象
PdfDocument pdf = new PdfDocument(new PdfWriter(dest));
System.out.println(pdf.getPdfVersion());
PageSize nUpPageSize = new PageSize(707 / _PT_CM_RATE, 47 / _PT_CM_RATE);
PdfPage page = pdf.addNewPage(nUpPageSize);
//画布的生成
PdfCanvas canvas = new PdfCanvas(page);
//Scale page
AffineTransform transformationMatrix = AffineTransform.getScaleInstance(1, 1);
canvas.concatMatrix(transformationMatrix);//不旋转
//添加右侧黑光标
PdfDocument pdfBlack = new PdfDocument(new PdfReader("results/black_47.pdf"));
PdfPage blackPage = pdfBlack.getPage(1);
Rectangle origBlack = blackPage.getPageSize();
PdfFormXObject pageBlackCopy = blackPage.copyAsFormXObject(pdf);
canvas.addXObject(pageBlackCopy, 0, 0);
//遍历稿件list
int j = 0;
for (String work : arrayList) {
//读取稿件内容
PdfDocument workPdf = new PdfDocument(new PdfReader(work));
PdfPage workPdfPage = workPdf.getPage(1);
//pdf转化为图片资源
// byte[] contentBytes = workPdfPage.getContentBytes();
// ImageData image = ImageDataFactory.create(contentBytes);
// canvas.addImage(image, 0,-1,1,0,_PILLOW_HEIGHT*j+origBlack.getWidth(),_PILLOW_WIDTH);
//pdf转化为formX
PdfFormXObject workPdfPageForm = workPdfPage.copyAsFormXObject(pdf);
canvas.addXObject(workPdfPageForm, 0,-1,1,0,_PILLOW_HEIGHT*j+origBlack.getWidth(),_PILLOW_WIDTH);
workPdf.close();
j++;
}
canvas.addXObject(pageBlackCopy,_PILLOW_HEIGHT*10+origBlack.getWidth(),0);
pdfBlack.close();
pdf.close();
}
}
参考文章
https://itextpdf.com/en/resources/examples/itext-5-legacy/chapter-6-working-existing-pdfs
itext5和itext7操作pdf平铺和图层叠加(tiling, and N-upping)的更多相关文章
- Java 设置PDF平铺图片背景(水印)
一.概述及环境准备 本文介绍使用免费版PDF库-Free Spire.PDF for Java加载图片来设置成PDF平铺图片背景的效果,也可以作为平铺图片水印来使用:编辑代码前,需要先导入jar文件, ...
- UIImage图片处理,旋转、截取、平铺、缩放等操作
来源:iOS_小松哥 链接:http://www.jianshu.com/p/9ab1205f5166 有时候我们需要处理图片,比如改变大小,旋转,截取等等,所以今天说一说图片处理相关的一些操作. 本 ...
- 5 分钟掌握 JS 实用窍门技巧,帮你快速撸码--- 删除数组尾部元素、E6对象解构、async/await、 操作平铺嵌套多维数组等
1. 删除数组尾部元素 一个简单方法就是改变数组的length值: const arr = [11, 22, 33, 44, 55, 66]; arr.length = 3; console.log( ...
- JSON平铺功能的实现(JS操作JSON数据)
一.什么是JSON平铺 JSON平铺分成两种: 平铺的json转树结构的json 例如: { a: 'value', b: 'b1.value' } // 转换成=> { a: 'value', ...
- 深度学习原理与框架-递归神经网络-RNN_exmaple(代码) 1.rnn.BasicLSTMCell(构造基本网络) 2.tf.nn.dynamic_rnn(执行rnn网络) 3.tf.expand_dim(增加输入数据的维度) 4.tf.tile(在某个维度上按照倍数进行平铺迭代) 5.tf.squeeze(去除维度上为1的维度)
1. rnn.BasicLSTMCell(num_hidden) # 构造单层的lstm网络结构 参数说明:num_hidden表示隐藏层的个数 2.tf.nn.dynamic_rnn(cell, ...
- 建模:通过ES平铺关系型数据库多表的数据
问:建模要从一个限界上下文中来建模,是否可以简单的把几张表进行笛卡尔乘积方式的平铺? 答:不能,原因之一,数据量会急剧增长:原因之二,这样的平铺是毫无意义的,必须要定义一个维度,在这个维度上根据需求约 ...
- C# 处理PPT水印(三)—— 在PPT中添加多行(平铺)文本水印效果
在PPT幻灯片中,可通过添加形状的方式,来实现类似水印的效果,可添加单一文本水印效果,即幻灯片中只有一个文本水印:也可以添加多行(平铺)文本水印效果,即幻灯片中以一定方式平铺排列多个文本水印效果.本文 ...
- Java使用iText7生成PDF
前言 我们之前使用js库html2canvas + jspdf实现html转PDF.图片,并下载(详情请戳:html页面转PDF.图片操作记录),大致原理是将页面塞到画布里,以图片的方式放到PDF中, ...
- Mac下的平铺式桌面 - Yabai
Mac下的平铺式桌面 - Yabai 近来无事,凑着周末休息的时间,想折腾一下 Mac.很久之前就有朋友给我推荐过一款名为"Yabai"的平铺式桌面管理软件,今天,就折腾起来了. ...
随机推荐
- POJ2763 Housewife Wind 树链剖分 边权
POJ2763 Housewife Wind 树链剖分 边权 传送门:http://poj.org/problem?id=2763 题意: n个点的,n-1条边,有边权 修改单边边权 询问 输出 当前 ...
- Team Foundation Server 2015使用教程【1】:团队项目创建
- C++Review5_Swap交换
面试中可能会问到交换两个变量的值有几种实现方式,对这方面有一定了解还是有必要的,简单罗列一下几种方式,具体介绍查看参考链接: 1.中间变量:->这个最常见了 2.加减法: 3.异或法: 4.sw ...
- IDEA环境使用Git
推送到Github 在设置中登录github账户 点击OK 将项目交给Git管理 之后项目文件就会变成红色 添加文件到暂存区 点击Add之后,项目文件会变成绿色 添加文件到本地仓库 点击Commit ...
- Oracle 11g静默安装
1.检查安装包 安装依赖包 yum -y install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elf ...
- 菜鸟系列Fabric源码学习 — committer记账节点
Fabric 1.4 源码分析 committer记账节点 本文档主要介绍committer记账节点如何初始化的以及committer记账节点的功能及其实现. 1. 简介 记账节点负责验证交易和提交账 ...
- Java锁对象和条件对象的使用
锁对象 临界区:临界区是一个特殊的代码段,该代码段访问某种特殊的公共资源,该资源同一时间只允许一个线程使用. Java中可以使用锁对象创造一个临界区: myLock.lock(); try { 关键代 ...
- 洛谷训练新手村之“BOSS战-入门综合练习1”题解
P1478 陶陶摘苹果(升级版) 题目链接:https://www.luogu.com.cn/problem/P1478 题目大意:陶陶有s点体力值,每个苹果消耗体力值,问s体力值最多能摘多少苹果. ...
- 小小知识点(二十一)如何修改PPT母版上无法直接点击修改的文字
1. 进入PPT后,选择下图右上角红色圈出的“视图”,接着选择下方红色圈出的“幻灯片母版”: 2.点击进入母版,如下图所示,最上面一栏第一个选项变成了“幻灯片母版”,在下面一栏最右边变成了“关闭母版视 ...
- VS Code配置C/C++环境
VS Code配置C/C++环境 一.下载和安装VS Code 1.访问VS Code官网下载安装包 2.安装VS Code 3. 安装后, 打开VS Code是英文,按住Ctrl+shift+x进入 ...