Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
feicien committed Aug 7, 2013
1 parent ae3d2d1 commit b6aaaed
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion PrintDemo/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
Expand Down
2 changes: 1 addition & 1 deletion PrintDemo/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>jpsycn-print-201306131633</name>
<name>PrintDemo</name>
<comment></comment>
<projects>
</projects>
Expand Down
2 changes: 1 addition & 1 deletion PrintDemo/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-17
target=android-18
android.library=true
71 changes: 36 additions & 35 deletions PrintDemo/src/com/jpsycn/print/util/PDFUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -401,21 +401,12 @@ public static boolean createReSamplePdf(Context mContext, File file,
table1.addCell(ItextUtil.getCell(simfang12, "商标", p + q + r));
table1.addCell(ItextUtil.getCell(bf, map.get("product_brand"), s));

table1.addCell(ItextUtil.getCell(simfang12, "抽样数量", n + o1));
table1.addCell(ItextUtil.getCell(bf, map.get("sampling_number"), o2
+ o3));

table1.addCell(ItextUtil.getCell(simfang12, "产品等级", p + q + r));
table1.addCell(ItextUtil.getCell(bf, map.get("product_level"), s));

table1.addCell(ItextUtil.getCell(simfang12, "抽样基数/批量", n + o1));
table1.addCell(ItextUtil.getCell(bf,
map.get("sampling_total_number"), o2 + o3));

table1.addCell(ItextUtil.getCell(simfang12, "标注执行标准/技术文件", p + q
+ r));
table1.addCell(ItextUtil.getCell(bf, map.get("product_standard"), s));

//
gg(map, simfang12, bf, table1);


//
table1.addCell(ItextUtil.getCell(simfang12, "抽样日期", n + o1));
table1.addCell(ItextUtil.getCell(bf, map.get("samplint_date"), o2
+ o3));
Expand Down Expand Up @@ -558,6 +549,7 @@ public static boolean createSpaqPdf(Context mContext, File file,
*/

Font simfang12 = FontUtil.getFont(mContext, 12, "simfang.ttf");

Font bf = FontUtil.getFont(mContext, 12, "simfang.ttf", Font.BOLD,
null);

Expand Down Expand Up @@ -685,17 +677,21 @@ public static boolean createSpaqPdf(Context mContext, File file,
ItextUtil.checked("中外合作", companyType), s));

table1.addCell(ItextUtil.getCell(20f, simfang12, "企业规模", n, 2));

StringBuilder sb3 = new StringBuilder();
sb3.append("产值:");
sb3.append("人数:");
sb3.append(map.get("company_person_number") == null ? " " : map
.get("company_person_number"));
sb3.append("产量:");
sb3.append(" 产值:");
sb3.append(map.get("company_output_value") == null ? " " : map
.get("company_output_value"));
sb3.append("人数:");
sb3.append(" 产量:");
sb3.append(map.get("company_production") == null ? " " : map
.get("company_production"));
table1.addCell(ItextUtil.getCell(20f, simfang12, sb3.toString(), o1
//sb3.append("人数:10000 产值:5000万 产量:1000吨");

Font simfang10 = FontUtil.getFont(mContext, 9, "simfang.ttf");
table1.addCell(ItextUtil.getCell(20f, simfang10, sb3.toString(), o1
+ o2 + o3));

table1.addCell(ItextUtil.getCell(20f, simfang12,
Expand Down Expand Up @@ -738,23 +734,9 @@ public static boolean createSpaqPdf(Context mContext, File file,
table1.addCell(ItextUtil.getCell(20f, bf, map.get("product_brand"),
s));

table1.addCell(ItextUtil.getCell(20f, simfang12, "抽样数量", n + o1));
table1.addCell(ItextUtil.getCell(20f, bf,
map.get("sampling_number"), o2 + o3));

table1.addCell(ItextUtil.getCell(20f, simfang12, "产品等级", p + q + r));
table1.addCell(ItextUtil.getCell(20f, bf, map.get("product_level"),
s));

table1.addCell(ItextUtil.getCell(20f, simfang12, "抽样基数/批量", n + o1));
table1.addCell(ItextUtil.getCell(20f, bf,
map.get("sampling_total_number"), o2 + o3));

table1.addCell(ItextUtil.getCell(20f, simfang12, "标注执行标准/技术文件", p
+ q + r));
table1.addCell(ItextUtil.getCell(20f, bf,
map.get("product_standard"), s));

//
gg(map, simfang12, bf, table1);
//
table1.addCell(ItextUtil.getCell(20f, simfang12, "抽样日期", n + o1));
table1.addCell(ItextUtil.getCell(20f, bf, map.get("samplint_date"),
o2 + o3));
Expand Down Expand Up @@ -881,4 +863,23 @@ public static boolean createSpaqPdf(Context mContext, File file,
}
}

private static void gg(Map<String, String> map, Font simfang12, Font bf,
PdfPTable table1) {
table1.addCell(ItextUtil.getCell(simfang12, "抽样数量", 23));
table1.addCell(ItextUtil.getCell(bf, map.get("sampling_number"), 11
));

table1.addCell(ItextUtil.getCell(simfang12, "产品等级", 11));
table1.addCell(ItextUtil.getCell(bf, map.get("product_level"), 10));

table1.addCell(ItextUtil.getCell(simfang12, "抽样基数/批量", 20));
table1.addCell(ItextUtil.getCell(bf,
map.get("sampling_total_number"), 20));

table1.addCell(ItextUtil.getCell(simfang12, "标注执行标准/技术文件", 23+11
));
table1.addCell(ItextUtil.getCell(bf, map.get("product_standard"), 61));

}

}

0 comments on commit b6aaaed

Please sign in to comment.