Real-estate registration — generate this PDF with Java (Template)
Template2 页 A4 · 35 KB
Real-estate registration acceptance / title certificate receipt.

Output specs
- PDF pages
- 2
- Chart type
- Template
- Template lines
- 162
- Source lines
- 128
Java source · JQuickBiz159RealEstateRegistrationReceipt.java
This is the complete test class that produced the PDF above — copy it and run as-is; see the quick-start section for the Maven dependency.
/*
* 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 ([email protected])
*/
package com.github.paohaijiao.biz.gov;
import com.github.paohaijiao.config.JPdfConfig;
import com.github.paohaijiao.executor.JQuickPdfFactory;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 单据 159:不动产登记受理单 / 不动产权证回执(gov 领域第 5 项)。
*
* <p>本类为独立可运行 Demo:自带 {@code main} 方法、不依赖任何公共工具类或实体类,
* 数据以 key-value 形式通过 {@link JQuickPdfFactory#bindAll(Map)} 注入,
* 版式全部落在模板文件 {@code demo/biz/gov/159_real_estate_registration_receipt.txt} 中。</p>
*
* <p>视觉主题「天青·厚框·通栏」:主色 #237172、辅色 #912756、浅底 #F1F6F6;
* 版式为 banner 抬头 + kv 信息区 + solid 明细表 + right 签章区 + plain 落款,
* 与同领域其它单据互不重样。</p>
*
* <p>不动产登记受理单 / 不动产权证回执:登记类型与不动产单元号、坐落与面积用途,</p>
* <p>申请材料清单与核验结果、登记结果与登记机构签章栏。</p>
*
* <p>运行后输出:{@code D:/test/pdf/159_real_estate_registration_receipt.pdf}。</p>
*
* @author Martin
* @version 1.0.0
*/
public class JQuickBiz159RealEstateRegistrationReceipt {
private static final String PDF_DIR = "D:/test/pdf/";
private static final String OUT_FILE = PDF_DIR + "159_real_estate_registration_receipt.pdf";
private static final String TEMPLATE = "demo/biz/gov/159_real_estate_registration_receipt.txt";
/** 模板固定明细行数,不足时补空行,避免占位符原样输出。 */
private static final int ITEM_ROWS = 6;
public static void main(String[] args) throws IOException {
new File(PDF_DIR).mkdirs();
// ---------- 1. 数据(无实体类,直接 bind)----------
String[][] items = {
{"1", "不动产登记申请表", "原件", "1", "齐全", "—"},
{"2", "申请人身份证明 / 营业执照", "复印件盖章", "1", "齐全", "—"},
{"3", "不动产权属证书(原证)", "原件", "1", "齐全", "—"},
{"4", "买卖合同 / 成交确认书", "原件", "2", "齐全", "—"},
{"5", "完税凭证(契税、印花税)", "原件", "1", "齐全", "—"},
{"6", "测绘报告及附图", "原件", "1", "齐全", "—"}
};
Map<String, Object> data = new LinkedHashMap<String, Object>();
data.put("acceptNo", "BD-20261022-0093");
data.put("acceptDate", "2026年10月22日");
data.put("orgName", "××市自然资源和规划局不动产登记中心");
data.put("registerType", "国有建设用地使用权及房屋所有权转移登记");
data.put("applicant", "××智能装备制造有限公司");
data.put("creditCode", "91320100MA1X7K38XG");
data.put("location", "××市××区智造大道 168 号 A 座 1-6 层");
data.put("unitNo", "320100 001008 GB00012 F00010001");
data.put("certNo", "苏(2026)××市不动产权第 0088123 号");
data.put("areaInfo", "12860.55 ㎡ / 工业用房");
data.put("feeInfo", "登记费 550.00 元,印花税 2580.00 元");
data.put("certInfo", "2026年10月29日 / 窗口领证");
data.put("result", "经审核,申请登记的不动产权利归属清楚、材料齐全,予以登记,不动产权证将于 2026 年 10 月 29 日核发。");
data.put("remark", "不动产登记自受理之日起 30 个工作日内办结;申请人可凭受理编号在不动产登记大厅或网上查询进度。");
data.put("acceptor", "苏见宁");
data.put("reviewer", "柳文渊");
data.put("applicantSign", "崔行知");
// 明细逐格展开
for (int i = 0; i < ITEM_ROWS; i++) {
int n = i + 1;
if (i >= items.length) {
data.put("itemName" + n, "—");
data.put("itemSpec" + n, "—");
data.put("itemUnit" + n, "—");
data.put("itemQty" + n, "—");
data.put("itemPrice" + n, "—");
data.put("itemAmount" + n, "—");
continue;
}
data.put("itemName" + n, items[i][0]);
data.put("itemSpec" + n, items[i][1]);
data.put("itemUnit" + n, items[i][2]);
data.put("itemQty" + n, items[i][3]);
data.put("itemPrice" + n, items[i][4]);
data.put("itemAmount" + n, items[i][5]);
}
// ---------- 2. 渲染 ----------
JPdfConfig config = new JPdfConfig();
config.getLayoutConfig().setFlexLayout(true);
config.getDoc().setMargins(Arrays.asList(48, 48, 48, 48));
config.getFontConfig().setDefaultFontName("Noto Sans CJK SC");
config.getHeaderConfig().setEnabled(true);
config.getHeaderConfig().setText("××市不动产登记中心 不动产登记受理单 BD-20261022-0093");
config.getHeaderConfig().setFontSize(7.5f);
config.getHeaderConfig().setHeight(34);
config.getFooterConfig().setEnabled(true);
config.getFooterConfig().setFontSize(8);
config.getFooterConfig().setPageNumberFormat("第 %d 页");
JQuickPdfFactory factory = new JQuickPdfFactory(config);
factory.bindAll(data);
byte[] pdf = factory.executeResource(TEMPLATE);
Files.write(new File(OUT_FILE).toPath(), pdf);
System.out.println("已生成:" + OUT_FILE + "(" + pdf.length + " 字节)");
}
}Minimal invocation (3 lines)
Skip the full test class — the core is these three lines: bind the chart SVG, execute the template, get the PDF bytes. Copy them straight into your project.
// config 可省略;svg 来自 JChartRendererFactory.renderChart(...),见下方完整源码
byte[] pdf = new JQuickPdfFactory(config).executeResource("demo/biz/gov/159_real_estate_registration_receipt.txt");Template file · 159_real_estate_registration_receipt.txt
An HTML-like template with inline CSS that renders to PDF once bound to data. The full template is below — copy it or download the raw file.
<pdf>
<body>
// 159 不动产登记受理单 / 不动产权证回执(gov 领域第 5 项) 视觉主题:天青·厚框·通栏
// 版式组合:抬头=banner 信息区=kv 明细表=solid 段落=plain 签章=right 落款=plain
// 主色 #237172 辅色 #912756 浅底 #F1F6F6
// 不动产登记受理单与不动产权回执:不动产单元号、坐落面积、材料清单与领证方式。
// 抬头:banner
<table style="width:100%; marginBottom:6px">
<tr>
<td style="width:58%; padding:8px; backgroundColor:#237172; color:white; bold:true; fontSize:15pt; characterSpacing:4pt">'不动产登记受理单 / 不动产权证回执'</td>
<td style="padding:8px; backgroundColor:#0E4E4F; color:white; textAlign:right; fontSize:7.5pt">'受理编号 '${acceptNo}' 受理日期 '${acceptDate}' 登记机构 '${orgName}</td>
</tr>
</table>
// 信息区:kv
<table style="width:100%; fontSize:9pt; marginBottom:8px">
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'受理编号 / NO.'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${acceptNo}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'受理日期 / DATE'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${acceptDate}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'登记机构'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${orgName}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'登记类型'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${registerType}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'申请人 / 权利人'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${applicant}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'证件号码 / 信用代码'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${creditCode}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'不动产坐落'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${location}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'不动产单元号'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${unitNo}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'不动产权证号'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${certNo}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'建筑面积 / 用途'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${areaInfo}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'登记费用'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${feeInfo}</td>
</tr>
<tr>
<td style="width:22%; padding:5px; backgroundColor:#F1F6F6; bold:true; border:1px solid #C0D5D5">'领证日期 / 方式'</td>
<td style="padding:5px; border:1px solid #C0D5D5">${certInfo}</td>
</tr>
</table>
<p style="fontSize:10.5pt; bold:true; color:#0E4E4F; marginBottom:4px">'登记申请材料清单'</p>
<table style="width:100%; fontSize:8pt; marginBottom:8px">
<tr>
<th style="width:7%; padding:4px; backgroundColor:#237172; color:white; bold:true; textAlign:center; border:1px solid #237172">'序号'</th>
<th style="width:28%; padding:4px; backgroundColor:#237172; color:white; bold:true; textAlign:center; border:1px solid #237172">'材料名称'</th>
<th style="width:14%; padding:4px; backgroundColor:#237172; color:white; bold:true; textAlign:center; border:1px solid #237172">'材料形式'</th>
<th style="width:10%; padding:4px; backgroundColor:#237172; color:white; bold:true; textAlign:center; border:1px solid #237172">'份数'</th>
<th style="width:14%; padding:4px; backgroundColor:#237172; color:white; bold:true; textAlign:center; border:1px solid #237172">'核验结果'</th>
<th style="padding:4px; backgroundColor:#237172; color:white; bold:true; textAlign:center; border:1px solid #237172">'备注'</th>
</tr>
<tr>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemName1}</td>
<td style="padding:4px; textAlign:left; border:1px solid #C0D5D5">${itemSpec1}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemUnit1}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemQty1}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemPrice1}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemAmount1}</td>
</tr>
<tr>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemName2}</td>
<td style="padding:4px; textAlign:left; border:1px solid #C0D5D5">${itemSpec2}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemUnit2}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemQty2}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemPrice2}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemAmount2}</td>
</tr>
<tr>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemName3}</td>
<td style="padding:4px; textAlign:left; border:1px solid #C0D5D5">${itemSpec3}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemUnit3}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemQty3}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemPrice3}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemAmount3}</td>
</tr>
<tr>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemName4}</td>
<td style="padding:4px; textAlign:left; border:1px solid #C0D5D5">${itemSpec4}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemUnit4}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemQty4}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemPrice4}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemAmount4}</td>
</tr>
<tr>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemName5}</td>
<td style="padding:4px; textAlign:left; border:1px solid #C0D5D5">${itemSpec5}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemUnit5}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemQty5}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemPrice5}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemAmount5}</td>
</tr>
<tr>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemName6}</td>
<td style="padding:4px; textAlign:left; border:1px solid #C0D5D5">${itemSpec6}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemUnit6}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemQty6}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemPrice6}</td>
<td style="padding:4px; textAlign:center; border:1px solid #C0D5D5">${itemAmount6}</td>
</tr>
</table>
// 段落:plain
<p style="fontSize:10.5pt; bold:true; color:#0E4E4F; marginBottom:3px">'登记结果'</p>
<p style="fontSize:9pt; marginBottom:6px">${result}</p>
<p style="fontSize:10.5pt; bold:true; color:#0E4E4F; marginBottom:3px">'备注 / REMARKS'</p>
<p style="fontSize:9pt; marginBottom:6px">${remark}</p>
// 签章区:right
<!-- 签章占位区:后续加盖电子公章 / 骑缝章 / 打印二维码 -->
<table style="width:100%; fontSize:8pt; marginBottom:8px">
<tr>
<td style="width:32%; padding:5px; backgroundColor:#F1F6F6; fontSize:7.5pt; color:#78838C; border:1px solid #C0D5D5">'本联次加盖印章后有效,扫码可验真'</td>
<td style="padding:3px; textAlign:center; color:#237172; border:1px dashed #237172">'(行政审批专用章 / 公章占位)' '(骑缝章 / 二维码占位)'</td>
</tr>
<tr>
<td style="width:32%%; padding:4px">' '</td>
<td style="padding:3px; textAlign:center; color:#78838C; border:1px dashed #237172">'受理机关:'${orgName} '骑缝章沿右边线骑缝加盖'</td>
</tr>
<tr>
<td style="width:32%%; padding:4px">' '</td>
<td style="padding:3px; textAlign:center; color:#78838C; border:1px dashed #237172">'办结日期:'${acceptDate} '二维码打印于右上角方框内'</td>
</tr>
</table>
// 落款:plain
<!-- 落款栏 -->
<table style="width:100%; fontSize:9pt; marginTop:6px">
<tr>
<td style="width:33%; padding:4px; color:#0E4E4F; borderBottom:1px solid #C0D5D5">'受理人:'${acceptor}</td>
<td style="width:33%; padding:4px; color:#0E4E4F; borderBottom:1px solid #C0D5D5">'审核人:'${reviewer}</td>
<td style="padding:4px; color:#0E4E4F; borderBottom:1px solid #C0D5D5">'申请人签收:'${applicantSign}</td>
</tr>
</table>
</body>
</pdf>More demos in this group
The PDF, preview image, template and source code on this page were all produced by a real JQuick-Pdf run and are free to copy into your own project.