Icepdf 특수 문자 렌더링 문제 (Icepdf special character rendering issue)


문제 설명

Icepdf 특수 문자 렌더링 문제 (Icepdf special character rendering issue)

PDF 생성을 위한 매우 상세한 렌더링 기능이 있기 때문에 PDF 파일을 생성하기 위해 itext 라이브러리를 사용합니다. 사용자가 버튼을 클릭할 때마다 템플릿을 작성하고 DB의 빈 셀을 채웁니다.

사용자에게 보여주고 생성된 pdf 파일을 출력하기 위해 Icepdf 라이브러리를 사용합니다.

하지만 Icepdf에는 문자 인코딩 문제가 있는 것 같습니다. Icepdf에서 PDF를 만들고 호출하면 터키어 문자 중 하나가 정사각형으로 보입니다. 터키어 문자는 이 링크에서 볼 수 있습니다. 모든 문자가 성공적으로 렌더링되었지만 그림의 8번째 문자는 렌더링되지 않았습니다.

생성된 pdf 파일의 파일 경로(에 의해 생성됨)로 이동할 때 itext 라이브러리) 모든 문자가 올바르게 표시되도록 Adobe Acrobat Reader를 사용하여 수동으로 엽니다. 그러나 프로그램 방식으로 Icepdf 파일을 열고 사용자에게 표시하면 그림의 8번째 문자가 정사각형으로 보입니다.

Icepdf의 문자 인코딩을 변경해야 하지만 아직 할 수 없습니다. Icepdf의 문자 및 Font 인코딩에 대한 많은 기사를 읽었지만 아직 성공하지 못했습니다. 이 문자 문제를 해결하면 내 애플리케이션을 배포할 준비가 됩니다.

생성된 PDF 파일을 다운로드할 수 있습니다. 여기.

Adobe Acrobat으로 이 파일을 열면 다음과 같이 표시됩니다.

how can i embed the spesific font file to PDF with iText " After 1‑2 days later, i found solution just like below;

Going to Windows Control Panel\Appearance and Personalization\Fonts and copy the times.ttf (which tested all special characters supported font) file to my Java Application resources container.

Than i add below lines to top of my createPDF method.

Font fontBase = FontFactory.getFont("/resources/times.ttf",
                                     BaseFont.IDENTITY_H,
                                     BaseFont.EMBEDDED,
                                     0.8f, Font.NORMAL,
                                     BaseColor.BLACK);
BaseFont bf = fontBase.getBaseFont();

After this, viewPdf() method get the document to screen with all special characters truely rendering.

(by Black WhiteBlack White)

참조 문서

  1. Icepdf special character rendering issue (CC BY‑SA 2.5/3.0/4.0)

#itext #fonts #icepdf #pdf #java






관련 질문

iText로 가변 페이지 PDF를 생성하려고 할 때 예외 (Exception when attempting to generate variable-page PDF with iText)

Icepdf 특수 문자 렌더링 문제 (Icepdf special character rendering issue)

JAVA에서 PDF 양식 테이블 채우기 (Filling PDF form tables in JAVA)

itext를 사용하여 poi에서 차트 내보내기 (Exporting charts from poi using itext)

표 셀에 사각형을 그리는 방법은 무엇입니까? (How to draw rectangles in a Table cell?)

동적 컨트롤로 PDF 양식 템플릿 수정 (Modify PDF Form Template with dynamic controls)

itext와 같은 라이브러리로 Java 응용 프로그램을 배포하는 방법은 무엇입니까? (how to distribute a java-application with libraries such as itext?)

종이 Itext7에서 첫 번째 줄과 마지막 줄 속성을 제거합니다. (Remove the first and last lines properties in the paper Itext7)

Java에서 iText 5를 사용하여 여러 셀을 만들고 각 셀에 각 문자를 설정하는 방법 (How to create multiple cells and set each character into each cell using iText 5 in Java)

iTextSharp(또는 iText 5)를 사용하여 다른 PdfImportedPage의 배경으로 전체 PdfImportedPage를 추가하는 방법 (How to add a full PdfImportedPage as background for another PdfImportedPage with iTextSharp (or iText 5))

그래픽 텍스트 효과가 있는 텍스트 요소 (Text element with graphical text effects)

iText7을 사용하여 PDFButtonFormField에 이미지를 추가할 때 종횡비를 유지하는 방법 (How to Maintain Aspect Ratio when Adding an Image to a PDFButtonFormField using iText7)







코멘트