저는 방금 iText (5.4.2, 최신 버전)로 작업하기 시작했습니다. 아직까지 직설적으로 다루지 못했던 두 가지가 있습니다.iText 가로 방향 및 위치 지정?
- 가로로 문서 만들기. 모든 페이지가 세로로 렌더링됩니다.
- 주어진 위치에 이미지를 삽입하십시오 (상단에서 & 왼쪽에서의 밀리미터 수).
아래 코드가 있습니다.
Document d = new Document(PageSize.A4_LANDSCAPE,0,0,0,0);
PdfWriter writer = PdfWriter.getInstance(d, new FileOutputStream("C:/test.pdf"));
document.open();
document.newPage();
Image img = Image.getInstance(String.format("C:/file.png"));
img.scaleToFit(400,240);
document.left(100f);
document.top(150f);
document.add(img);
document.close();
그러나 페이지가 세로 (안 풍경)에서 렌더링되고 이미지가 왼쪽 상단에 넣어 (요청하지 10 및 15 개 단위 멀리에서로). 내가 도대체 뭘 잘못하고있는 겁니까?