jquick-pdf 个人简历 PDF 实战:深蓝侧栏双栏与单栏通版两种风格怎么选
摘要(meta description):简历是最挑排版的内容类型,配色与版式选错,再好的经历也显乱。本文以 jquick-pdf 个人简历 Demo 为例,把深蓝侧栏双栏风格和单栏通版风格放上同一张对照表,从信息分区、视觉重心、投递场景到折行风险逐行比;再跟着模板走完左栏 185px 侧栏、右栏时间轴、竖条小节标题的实现细节,两处真实的折行事故也在文中复盘。附完整 Java 源码与模板(jquick-pdfx 4.7.0+,Apache-2.0)。
标签:jquick-pdf、Java PDF、报表开发、简历排版
官网示例:
- FORMULAS 示例页:https://www.jquick.org/jquick-pdf/demo/49_resume/
- github 地址:https://github.com/paohaijiao/jquick-pdf
真实渲染效果预览
以下为上述代码 + 模板真实运行生成的 PDF 首屏预览(由 jquick-pdf 渲染输出,非示意图):
候选人资料到手,先把两种风格摆上桌
候选人陈嘉禾的资料是一份典型的分析师简历:7 年数据分析与数据平台建设经验,主导过 3 个从 0 到 1 的指标体系落地项目,两段工作经历、一段项目经验、三项证书、五项技能。要做一页可投递的 PDF,我面前有两个候选风格:
| 对照项 | 风格A:深蓝侧栏双栏 | 风格B:单栏通版 |
|---|---|---|
| 信息分区 | 左栏集中静态信息,右栏叙事经历 | 从上到下通排,靠标题分节 |
| 视觉重心 | 左侧整列 #23405C 深蓝色块 |
全页白底,重心在标题层级 |
| 适合内容 | 联系方式、技能、证书多而经历紧凑 | 经历条目长、描述细的档案型简历 |
| 折行风险 | 侧栏窄,文案长度要按字数卡 | 宽幅通栏,基本不怕折行 |
| 阅读动线 | 先看左栏身份,再右栏读经历 | 自上而下一条线 |
Demo JQuickBiz49ResumeTest 落地的是风格A。这个选择的前提先交代:目标是一页投递版简历,候选人静态信息(联系方式、技能、证书)占比高,侧栏能把它们从经历叙事里剥离出来,HR 十秒内扫完身份信息。表格的其余几行,下面逐节验证。(效果预览图 alt:jquick-pdf 个人简历 PDF,左栏深蓝底白字个人信息侧栏,右栏白底个人简介、工作经历时间轴与教育背景表格)
风格A的左栏:185px 里装下四组信息
左栏声明是 width:185px; background:#23405C; padding:12px 10px,深蓝底白字,从上到下四段:姓名与求职意向、联系方式、核心技能、职业证书,段与段之间用 lineSeparator style="strokeColor:#3C5166" 细线分隔。
<div style="width:185px; background:#23405C; padding:12px 10px">
<h1 style="color:white; fontSize:17pt; bold:true; characterSpacing:2pt; marginBottom:2px">'陈嘉禾'</h1>
对照表第五行的"折行风险"就出在这 185px 上。模板注释算过一笔账:减去左右内边距,侧栏可用宽度只有 165px,8pt 字号下每行文案不能超过 19 个汉字,超了就折行,且折行点容易落在"求职意向:"这类标签的冒号后,读起来像两段错乱的文字。所以侧栏每一行都按这个预算写短:'手机:138-0000-0000'、'邮箱:chenjiahe@example.com'、'城市:上海(可即时到岗)',颜色统一 #DCE6F0 浅蓝灰,把白色留给小节标题(10pt 加粗)。技能列表用 listStyleType:none 去掉圆点,每项"SQL / 数据建模 精通"这类"技能 程度"的两段式文案,全角空格分隔,五行排下来整齐得像表单。
风格B没有这道算术题,通栏宽度随便写。侧栏风格的美观是有维护成本的,这是对照表里它输给单栏的那一行。
左栏的配色也值得记一笔,因为它是四级蓝色梯度撑起来的层次:姓名 17pt 纯白并带 characterSpacing:2pt 字距,头衔"高级数据分析师"和求职意向用 #9FB3C8 中蓝灰,小节标题(联系方式、核心技能、职业证书)纯白 10pt 加粗,条目正文 #DCE6F0 浅蓝灰——底色 #23405C 不动,靠文字明度分出四层,视觉上有层级又不会花。注意右栏小节标题的 #1F4E79 和左栏底色 #23405C 是两个不同的深蓝:前者偏藏蓝偏亮,管正文区的强调色;后者更深偏灰,管侧栏的大面积底。两块深蓝在同页并存不打架,靠的就是一个当底色、一个当文字色,功能不重叠。
风格A的右栏:竖条标题与时间轴的宽度账
右栏 345px 白底,四个小节用统一的"左侧竖条标题":borderLeft:4px solid #1F4E79; paddingLeft:6px,12pt 深蓝加粗——个人简介、工作经历、项目经验、教育背景四段标题视觉完全一致,扫读时竖条就是目录。个人简介是一段 9pt #333333 的三行叙述,把 7 年经验、指标体系落地、数据质量治理三件事压进一个段落,内容列的宽度足够它不折出第四行。
工作经历是"时间 + 左色条"的时间轴结构,flex 分两列:
<div style="display:flex; justifyContent:space-between; marginBottom:8px">
<div style="width:100px">
<p style="fontSize:8pt; bold:true; color:#5A6B7C">'2021.06-至今'</p>
</div>
<div style="width:235px; borderLeft:2px solid #C3CDD8; paddingLeft:8px">
时间列 100px、内容列 235px,中间一道 borderLeft:2px solid #C3CDD8 浅灰竖线当时间轴。内容列里公司名与职位下面挂圆点职责列表(listStyleType:disc、8pt、#333333),最新一段经历三条职责(统一指标体系、指标血缘与稽核规则、带 6 人团队交付经营分析看板),前一段两条(门店经营分析、商品结构分析模型),职责多少随经历详略,模板没有强行凑齐。100px 这个数字也是算出来的:注释写明它"恰好容纳 '2018.03-2021.05' 这类 15 个半角字符的日期(约 92px)",日期连接符两侧不留空格——留了空格日期就折成两行,年份和月份被拆散。这是风格A(以及一切多栏布局)的通则:每个栏宽都要对最长的内容做预算,风格B里不存在的约束在这里处处都在。
两处折行事故的复盘
对照表"折行风险"这一行,Demo 注释里留了两起真实事故,值得单独复盘。
第一起在时间轴内容列。公司名与职位最初想拼一行,结果"两者拼在一行会超出 162pt 的可用宽度,折行后只剩一个'人'字落在第二行"——"××数字科技有限公司 数据平台负责人"折完第二行孤零零一个"人"字,注释的原话是"看起来像排版事故"。修复是分两行写:公司名 10pt 加粗 #1A2733 一行,职位 9pt #1F4E79 一行,职责列表用圆点 list 缀在下面。
第二起就是上文的时间列。这段经历给风格A定了条铁律:改文案先量字数,量完再看折不折。风格B的宽栏里这两起事故都不会发生——同一份内容换风格,风险清单完全不同,这就是对照表要贯穿全篇的原因。
教育背景回到表格,以及整页的最终选型
右栏收尾的教育背景没有用时间轴,而是回到两行表格:335px 宽,左列 100px 浅灰底 #E8EDF2 放时间段"2014.09-2018.06"与"主修课程",右列放"××大学 统计学 本科 / 学士"和四门课程。同一页里时间轴管经历、表格管学历档案,两种结构各管一类信息——这个混排思路两种风格都适用,不算风格A专属。
整份简历的 Java 侧同样极薄:biz49Resume() 十行,JPdfConfig 开 setFlexLayout(true)(左右双栏和时间轴都靠 display:flex,源码注释点名了这两处),executeResource("report/biz/49_resume.txt") 出 D:\test\biz\49_resume.pdf,不绑任何变量。
结论落在选边上。风格A适合:投递版单页简历、静态信息多、愿意按字数预算写文案;它换来的是十秒可扫的身份区和大气的第一印象。风格B适合:档案型长简历、内容会频繁增删改(不用每次重新卡字数)、黑白打印场景(深色侧栏打印时费墨且灰色发闷)。我的这批候选人统一走投递渠道,选了风格A;如果这页 PDF 的下游是简历解析系统,窄栏里的两段式文案("技能 程度"全角空格分隔)对解析器并不友好,那就要退回风格B。好看和好解析,多数时候只能选一头。
复现清单
- 依赖
io.github.paohaijiao:jquick-pdfx:4.7.0+(Apache-2.0 协议); - Java 侧
JPdfConfig.getLayoutConfig().setFlexLayout(true),executeResource("report/biz/49_resume.txt")输出D:\test\biz\49_resume.pdf,纯版式无变量绑定; - 左栏 185px
background:#23405C,可用宽度 165px,8pt 下每行不超过 19 个汉字; - 右栏小节标题统一
borderLeft:4px solid #1F4E79竖条;时间轴左列 100px(15 个半角字符预算)、内容列 235px 加borderLeft:2px solid #C3CDD8; - 公司名与职位分两行,避免 162pt 宽度下的单字折行;
- 教育背景用 335px 两行表格收尾,段间
lineSeparator与 list 列表按需混用。
完整源码附录
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Copyright (c) [2025-2099] Martin (goudingcheng@gmail.com)
*/
package com.github.paohaijiao.biz.chart;
import com.github.paohaijiao.config.JPdfConfig;
import com.github.paohaijiao.demo.constant.JQuickConstant;
import com.github.paohaijiao.executor.JQuickPdfFactory;
import org.junit.Test;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* 简历 Demo 49:个人简历(招聘 / 人才档案场景)
*
* <p>业务场景:把候选人信息排版成可直接投递的单页简历,左栏集中展示姓名、
* 联系方式、核心技能与证书,右栏按「个人简介 / 工作经历 / 项目经验 / 教育背景」展开。</p>
*
* <p>版式:左右双栏,左栏 185px 深蓝底白字侧栏;右栏正文各小节统一使用「左侧竖条标题」,
* 工作与项目经历采用「时间 + 左色条」的时间轴结构。</p>
*
* <p>本模板为纯版式 Demo,不含图表,因此不需要绑定 {@code svg} 变量;
* 模板:{@code report/biz/49_resume.txt},输出:{@code D:\test\biz\49_resume.pdf}。</p>
*
* @author Martin
* @version 1.0.0
*/
public class JQuickBiz49ResumeTest {
public static final String path = JQuickConstant.path;
@Test
public void biz49Resume() throws IOException {
File dir = new File(path + "biz");
if (!dir.exists()) {
dir.mkdirs();
}
FileOutputStream fileOutputStream = new FileOutputStream(path + "biz/49_resume.pdf");
JPdfConfig config = new JPdfConfig();
// 开启 flex 行布局,使模板中的 display:flex 生效(左右双栏 + 经历时间轴)
config.getLayoutConfig().setFlexLayout(true);
JQuickPdfFactory factory = new JQuickPdfFactory(config);
byte[] bytes = factory.executeResource("report/biz/49_resume.txt");
fileOutputStream.write(bytes);
fileOutputStream.close();
}
}
<pdf>
<body>
<div style="display:flex; justifyContent:space-between">
// ---------- 左栏:深色个人信息侧栏 ----------
<div style="width:185px; background:#23405C; padding:12px 10px">
<h1 style="color:white; fontSize:17pt; bold:true; characterSpacing:2pt; marginBottom:2px">'陈嘉禾'</h1>
// 侧栏可用宽度仅 165px(185px 减去左右内边距),每行文案都按「8pt 下不超过 19 个汉字」控制,
// 否则会折行,且折行点容易落在「求职意向:」这类标签的冒号后,读起来像两段错乱的文字。
<p style="color:#9FB3C8; fontSize:9pt; marginBottom:2px">'高级数据分析师'</p>
<p style="color:#9FB3C8; fontSize:8pt; marginBottom:8px">'求职意向:数据平台负责人'</p>
<lineSeparator style="strokeColor:#3C5166"></lineSeparator>
<p style="color:white; fontSize:10pt; bold:true; marginTop:8px; marginBottom:4px">'联系方式'</p>
<p style="color:#DCE6F0; fontSize:8pt; marginBottom:2px">'手机:138-0000-0000'</p>
<p style="color:#DCE6F0; fontSize:8pt; marginBottom:2px">'邮箱:chenjiahe@example.com'</p>
<p style="color:#DCE6F0; fontSize:8pt; marginBottom:2px">'城市:上海(可即时到岗)'</p>
<lineSeparator style="strokeColor:#3C5166"></lineSeparator>
<p style="color:white; fontSize:10pt; bold:true; marginTop:8px; marginBottom:4px">'核心技能'</p>
<list style="listStyleType:none; paddingLeft:2px; fontSize:8pt">
<li style="marginBottom:3px; color:#DCE6F0">'SQL / 数据建模 精通'</li>
<li style="marginBottom:3px; color:#DCE6F0">'Python / Pandas 熟练'</li>
<li style="marginBottom:3px; color:#DCE6F0">'指标体系设计 熟练'</li>
<li style="marginBottom:3px; color:#DCE6F0">'BI 可视化 熟练'</li>
<li style="marginBottom:3px; color:#DCE6F0">'AB 实验设计 了解'</li>
</list>
<lineSeparator style="strokeColor:#3C5166"></lineSeparator>
<p style="color:white; fontSize:10pt; bold:true; marginTop:8px; marginBottom:4px">'职业证书'</p>
<p style="color:#DCE6F0; fontSize:8pt; marginBottom:2px">'CDA 数据分析师(三级)'</p>
<p style="color:#DCE6F0; fontSize:8pt; marginBottom:2px">'PMP 项目管理专业人士'</p>
<p style="color:#DCE6F0; fontSize:8pt">'英语 CET-6(可读写技术文档)'</p>
</div>
// ---------- 右栏:白底正文,小节统一用「左侧竖条标题」 ----------
<div style="width:345px">
<h2 style="fontSize:12pt; bold:true; color:#1F4E79; borderLeft:4px solid #1F4E79; paddingLeft:6px; marginBottom:5px">'个人简介'</h2>
<p style="fontSize:9pt; color:#333333; marginBottom:6px">'7 年数据分析与数据平台建设经验,主导过 3 个从 0 到 1 的指标体系落地项目,覆盖零售、政务两类行业;擅长把业务口径翻译成可计算的指标定义,并推动数据质量治理闭环。'</p>
<h2 style="fontSize:12pt; bold:true; color:#1F4E79; borderLeft:4px solid #1F4E79; paddingLeft:6px; marginBottom:5px">'工作经历'</h2>
// 时间轴:左列 100px 恰好容纳「2018.03-2021.05」这类 15 个半角字符的日期(约 92px),
// 因此日期内的连接符两侧不留空格;留空格会使日期折成两行,年份与月份被拆散。
<div style="display:flex; justifyContent:space-between; marginBottom:8px">
<div style="width:100px">
<p style="fontSize:8pt; bold:true; color:#5A6B7C">'2021.06-至今'</p>
</div>
<div style="width:235px; borderLeft:2px solid #C3CDD8; paddingLeft:8px">
// 公司名与职位分两行写:两者拼在一行会超出 162pt 的可用宽度,折行后只剩一个「人」字
// 落在第二行,看起来像排版事故。
<p style="fontSize:10pt; bold:true; color:#1A2733; marginBottom:1px">'××数字科技有限公司'</p>
<p style="fontSize:9pt; color:#1F4E79">'数据平台负责人'</p>
<list style="listStyleType:disc; paddingLeft:14px; fontSize:8pt; color:#333333">
<li style="marginBottom:3px">'牵头搭建统一指标体系,消除口径冲突'</li>
<li style="marginBottom:3px">'建设指标血缘与稽核规则,缩短日报延迟'</li>
<li style="marginBottom:3px">'带 6 人团队交付经营分析看板'</li>
</list>
</div>
</div>
<div style="display:flex; justifyContent:space-between; marginBottom:8px">
<div style="width:100px">
<p style="fontSize:8pt; bold:true; color:#5A6B7C">'2018.03-2021.05'</p>
</div>
<div style="width:235px; borderLeft:2px solid #C3CDD8; paddingLeft:8px">
<p style="fontSize:10pt; bold:true; color:#1A2733; marginBottom:1px">'××连锁商业集团'</p>
<p style="fontSize:9pt; color:#1F4E79">'高级数据分析师'</p>
<list style="listStyleType:disc; paddingLeft:14px; fontSize:8pt; color:#333333">
<li style="marginBottom:3px">'负责门店经营分析,推动低效门店调整'</li>
<li style="marginBottom:3px">'搭建商品结构分析模型,压降滞销库存'</li>
</list>
</div>
</div>
<h2 style="fontSize:12pt; bold:true; color:#1F4E79; borderLeft:4px solid #1F4E79; paddingLeft:6px; marginBottom:5px">'项目经验'</h2>
<div style="display:flex; justifyContent:space-between; marginBottom:8px">
<div style="width:100px">
<p style="fontSize:8pt; bold:true; color:#5A6B7C">'2023.02-2023.11'</p>
</div>
<div style="width:235px; borderLeft:2px solid #C3CDD8; paddingLeft:8px">
<p style="fontSize:10pt; bold:true; color:#1A2733">'集团经营指标中台(项目负责人)'</p>
<p style="fontSize:8pt; color:#333333">'统一 320 个经营指标定义,交付指标检索、血缘追溯、异常预警三个模块。'</p>
</div>
</div>
<h2 style="fontSize:12pt; bold:true; color:#1F4E79; borderLeft:4px solid #1F4E79; paddingLeft:6px; marginBottom:5px">'教育背景'</h2>
<table style="width:335px; fontSize:8pt">
<tr>
<td style="width:100px; padding:4px; backgroundColor:#E8EDF2; bold:true; border:1px solid #C3CDD8">'2014.09-2018.06'</td>
<td style="padding:4px; border:1px solid #C3CDD8">'××大学 统计学 本科 / 学士'</td>
</tr>
<tr>
<td style="padding:4px; backgroundColor:#E8EDF2; bold:true; border:1px solid #C3CDD8">'主修课程'</td>
<td style="padding:4px; border:1px solid #C3CDD8">'概率论 / 多元统计 / 数据挖掘 / 计量经济'</td>
</tr>
</table>
</div>
</div>
</body>
</pdf>
