0
A
답변
0
이 this example 및 PdfPCell.setRowspan(int) 및 PdfPCell.setColspan(int)를 참조 다른 행에 다른 세포에 영향을주지 않고 2 행을 5 행까지 3 열의 셀을 확장합니다. 이와
0
안녕 plese 체크 .... 당신의 친절한 도움을
Document doc = new Document();
PdfWriter docWrite = null;
DecimalFormat df = new DecimalFormat("0.00");
DB.getPlayerName_OrderBy(TID1 , Match_ID);
try {
String path = Environment.getExternalStorageDirectory().getPath() + "/Cric";
Font bfBold12 = new Font(FontFamily.TIMES_ROMAN, 12, Font.BOLD, new BaseColor(0, 0, 0));
Font bf12 = new Font(FontFamily.TIMES_ROMAN, 12);
File dir = new File(path);
if(!dir.exists()){dir.mkdirs();}
Log.d("PDFCreator", "PDF Path: " + path);
File file = new File(dir, "cric_sample.pdf");
FileOutputStream fOut = new FileOutputStream(file);
docWrite = PdfWriter.getInstance(doc, fOut);
doc.addTitle("Cricket Scord Card 2013 PDF");
doc.addCreationDate();
doc.open();
Paragraph p1 = new Paragraph(teamBatting + " Socre Card 2013 ");
float[] columnWidths = {5f, 5f, 2f, 2f,2f,2f,2f};
PdfPTable table = new PdfPTable(columnWidths);
table.setWidthPercentage(90f);
insertCell(table, "Player Names", Element.ALIGN_LEFT, 1, bfBold12);
insertCell(table, "Wicket Status", Element.ALIGN_LEFT, 1, bfBold12);
insertCell(table, "Runs", Element.ALIGN_LEFT, 1, bfBold12);
insertCell(table, "Balls", Element.ALIGN_LEFT, 1, bfBold12);
insertCell(table, "6's", Element.ALIGN_LEFT, 1, bfBold12);
insertCell(table, "4's", Element.ALIGN_LEFT, 1, bfBold12);
insertCell(table, "SR", Element.ALIGN_LEFT, 1, bfBold12);
table.setHeaderRows(1);
for(int x= 0; x<DatabaseHandler.Player_SD.size(); x++){
float SR;
if(DatabaseHandler.Player_SD.get(x).StrikerName == null)
{
break;
}
else
{
if(DatabaseHandler.Player_SD.get(x).Mrun !=0 &&DatabaseHandler.Player_SD.get(x).MBolls !=0)
{
SR= (((float)DatabaseHandler.Player_SD.get(x).Mrun/(float)DatabaseHandler.Player_SD.get(x).MBolls)) * 100;
}
else
{
SR =(float) 0.00;
}
insertCell(table, String.valueOf(DatabaseHandler.Player_SD.get(x).StrikerName), Element.ALIGN_LEFT, 1, bf12);
insertCell(table, String.valueOf(DatabaseHandler.Player_SD.get(x).MOut), Element.ALIGN_LEFT, 1, bf12);
insertCell(table, String.valueOf(DatabaseHandler.Player_SD.get(x).Mrun) , Element.ALIGN_LEFT, 1, bf12);
insertCell(table, String.valueOf(DatabaseHandler.Player_SD.get(x).MBolls), Element.ALIGN_LEFT, 1, bf12);
insertCell(table, String.valueOf(DatabaseHandler.Player_SD.get(x).MSix), Element.ALIGN_LEFT, 1, bf12);
insertCell(table, String.valueOf(DatabaseHandler.Player_SD.get(x).MFour), Element.ALIGN_LEFT, 1, bf12);
insertCell(table, String.valueOf(String.format("%.1f",SR)), Element.ALIGN_LEFT, 1, bf12);
}
}
// p1.setAlignment(Paragraph.ALIGN_CENTER);
p1.add(table);
doc.add(p1);
} catch (DocumentException de) {
Log.e("PDFCreator", "DocumentException:" + de);
} catch (IOException e) {
Log.e("PDFCreator", "ioException:" + e);
}
finally
{
if(doc != null)
{
doc.close();
}
if(docWrite != null)
{
docWrite.close();
}
}
관련 문제
- 1. iText 셀 안에 중첩 테이블
- 2. iText 셀 테두리 텍스트를 자르다
- 3. Itext 일주일에 pdf
- 4. itext - pdf to html
- 5. 안드로이드에 iText PDF 리더
- 6. iText PDF 동적 생성
- 7. iText PDF 파일
- 8. itext pdf issue
- 9. 동일한 페이지에서 셀 시작, iText
- 10. iText Pdf 페이지 바이트 크기
- 11. iText PDF MultiColumnText 줄의 높이
- 12. iText 오류로 PDF 양식 채우기
- 13. iText 생성 PDF 자동 인쇄
- 14. itext 작성 테이블
- 15. Itext 테이블 위치 지정
- 16. IText #
- 17. pdf 테이블 내용 데이터를 읽는 방법?
- 18. 웹 응용 프로그램에서 PDF 만들기 iText
- 19. 테이블보기에 복수 열 테이블 표시
- 20. iText - 셀 텍스트의 높이를 셀의 높이로 맞추기
- 21. Android itext 이외의 PDF 파일 만들기
- 22. IText : pdf 안에 빈 페이지를 추가하는 방법?
- 23. iText PDF 링크에 닫는 대괄호가 포함되어 있습니다.
- 24. PDF 서명을위한 Java API (iText 사용 불가)
- 25. itext (java)에서 PDF 파일 크기 줄이기
- 26. iText 특정 페이지의 PDF 머리글 제거
- 27. CMY 색상의 iText PDF 만 작성하는 방법
- 28. iText - 두 번째 PDF 생성 시도 실패
- 29. iText : a3에 html로 된 pdf 파일을 생성합니다.
- 30. iText : PDF 페이지의 텍스트 위치 재 배열
감사 친애하는 코드 – user1409935