소스 정리

main
이범준 7 months ago
parent 57b6b2b692
commit c956c7e462

@ -391,10 +391,10 @@ public class PDFWriter {
float Xmm = XYmm[0]; float Xmm = XYmm[0];
float Ymm = XYmm[1]; float Ymm = XYmm[1];
float Xpt = Print.mmToPt(Xmm); float Xpt = CmmnUtil.mmToPt(Xmm);
float Ypt = Print.mmToPt(Ymm); float Ypt = CmmnUtil.mmToPt(Ymm);
float YptMax = Print.mmToPt(this.paperMilimeter[1]); float YptMax = CmmnUtil.mmToPt(this.paperMilimeter[1]);
return new PDFCoordinate(Xpt, Ypt, YptMax); return new PDFCoordinate(Xpt, Ypt, YptMax);
} }
@ -415,7 +415,7 @@ public class PDFWriter {
float[] xyAbsolute = this.toPDFCoordinate(XYmm).absolute(); float[] xyAbsolute = this.toPDFCoordinate(XYmm).absolute();
float textAreaWidth_pt = Print.mmToPt(textAreaWidth_mm); float textAreaWidth_pt = CmmnUtil.mmToPt(textAreaWidth_mm);
float allTextWidth = calcTextWidth(font, fontSize, allText); float allTextWidth = calcTextWidth(font, fontSize, allText);
@ -553,7 +553,7 @@ public class PDFWriter {
float[] xyAbsolute = this.toPDFCoordinate(XYmm).absolute(); float[] xyAbsolute = this.toPDFCoordinate(XYmm).absolute();
float[] size = new float[] { float[] size = new float[] {
Print.mmToPt(SIZEmm[0]),Print.mmToPt(SIZEmm[1]) CmmnUtil.mmToPt(SIZEmm[0]),CmmnUtil.mmToPt(SIZEmm[1])
}; };
try { try {
@ -722,8 +722,8 @@ public class PDFWriter {
float bottomFold = margin + partHeight; //하단접는곳 float bottomFold = margin + partHeight; //하단접는곳
float topFold = margin + (partHeight * 2); //상단접는곳 float topFold = margin + (partHeight * 2); //상단접는곳
float bottomFold_pt = Print.mmToPt(bottomFold); float bottomFold_pt = CmmnUtil.mmToPt(bottomFold);
float topFold_pt = Print.mmToPt(topFold); float topFold_pt = CmmnUtil.mmToPt(topFold);
try { try {
contentStream.setLineDashPattern(new float[]{3,1}, 0); contentStream.setLineDashPattern(new float[]{3,1}, 0);

@ -551,4 +551,8 @@ public class CmmnUtil {
dataObject.put("BARCODE1", barcode); dataObject.put("BARCODE1", barcode);
} }
public static float mmToPt(float mm) {
return mm * 2.83465f;
}
} }

@ -67,10 +67,6 @@ public class Print {
return this.fileNameIndex = fileNameIndex; return this.fileNameIndex = fileNameIndex;
} }
public static float mmToPt(float mm) {
return mm * 2.83465f;
}
public int getTotalDataCount(List<DataObject> dataObjectList) { public int getTotalDataCount(List<DataObject> dataObjectList) {
int totalDataCount = dataObjectList.size(); int totalDataCount = dataObjectList.size();

@ -12,7 +12,7 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageTree; import org.apache.pdfbox.pdmodel.PDPageTree;
import cokr.xit.fims.cmmn.Print; import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
public class PDFExtractionUtil { public class PDFExtractionUtil {
@ -50,10 +50,10 @@ public class PDFExtractionUtil {
for(DataObject extractStng : extractStngs) { for(DataObject extractStng : extractStngs) {
float x = Print.mmToPt(extractStng.number("LEFT_PSTN").floatValue()); float x = CmmnUtil.mmToPt(extractStng.number("LEFT_PSTN").floatValue());
float y = Print.mmToPt(extractStng.number("TOP_PSTN").floatValue()); float y = CmmnUtil.mmToPt(extractStng.number("TOP_PSTN").floatValue());
float w = Print.mmToPt(extractStng.number("WIDTH_SZ").floatValue()); float w = CmmnUtil.mmToPt(extractStng.number("WIDTH_SZ").floatValue());
float h = Print.mmToPt(extractStng.number("HEIGHT_SZ").floatValue()); float h = CmmnUtil.mmToPt(extractStng.number("HEIGHT_SZ").floatValue());
String text0 = ExtractText.getExtractByStng(pdDocument, pageIndex+1, x, y, w, h); String text0 = ExtractText.getExtractByStng(pdDocument, pageIndex+1, x, y, w, h);
textItem.put(extractStng.string("EXTR_ARTCL_NM"), text0); textItem.put(extractStng.string("EXTR_ARTCL_NM"), text0);

Loading…
Cancel
Save