public class CommonUtil extends Object
Copyright (c) 2020-2024 xsx All Rights Reserved. x-easypdf is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.
| 构造器和说明 |
|---|
CommonUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addBackgroundColor(Context context,
ContentMode mode,
boolean isResetContentStream,
org.apache.pdfbox.pdmodel.common.PDRectangle rectangle,
Color backgroundColor)
添加背景颜色
|
static void |
extractImage(List<BufferedImage> imageList,
org.apache.pdfbox.pdmodel.PDResources resources)
提取图像
|
static org.apache.pdfbox.pdmodel.common.PDRectangle |
getRectangle(float width,
float height)
获取行尺寸
|
static void |
initFontColorAndAlpha(org.apache.pdfbox.pdmodel.PDPageContentStream stream,
Color backgroundColor,
FontStyle fontStyle,
Color fontColor,
float fontAlpha)
初始化字体颜色及透明度
|
static void |
initMatrix(org.apache.pdfbox.pdmodel.PDPageContentStream stream,
float beginX,
float beginY,
float relativeBeginX,
float relativeBeginY,
float width,
float height,
float angle,
float alpha)
初始化矩阵
|
static double[] |
toDoubleArray(List<Double> list)
转基本双精度浮点型数组
|
static float[] |
toFloatArray(List<Float> list)
转基本浮点型数组
|
static int[] |
toIntArray(List<Integer> list)
转基本整型数组
|
public static void initFontColorAndAlpha(org.apache.pdfbox.pdmodel.PDPageContentStream stream,
Color backgroundColor,
FontStyle fontStyle,
Color fontColor,
float fontAlpha)
stream - 内容流backgroundColor - 背景色fontStyle - 字体样式fontColor - 字体颜色fontAlpha - 字体透明度public static void initMatrix(org.apache.pdfbox.pdmodel.PDPageContentStream stream,
float beginX,
float beginY,
float relativeBeginX,
float relativeBeginY,
float width,
float height,
float angle,
float alpha)
stream - 内容流beginX - X轴起始坐标beginY - Y轴起始坐标relativeBeginX - X轴相对起始坐标relativeBeginY - Y轴相对起始坐标width - 宽度height - 高度angle - 旋转角度alpha - 透明度public static void extractImage(List<BufferedImage> imageList, org.apache.pdfbox.pdmodel.PDResources resources)
imageList - 待接收图像列表resources - 页面资源public static void addBackgroundColor(Context context, ContentMode mode, boolean isResetContentStream, org.apache.pdfbox.pdmodel.common.PDRectangle rectangle, Color backgroundColor)
context - 上下文mode - 内容模式isResetContentStream - 是否重置内容流rectangle - 矩形backgroundColor - 背景颜色public static org.apache.pdfbox.pdmodel.common.PDRectangle getRectangle(float width,
float height)
width - 宽度height - 高度Copyright © 2024. All rights reserved.