문서의 무결성을 유지하기 위해 글꼴 대체가 허용되지 않는 인쇄 프로세스가 있습니다. 이를 수행하는 유일한 방법은 모든 글꼴이 포함되도록하는 것입니다. FontFactory.GetFont (문자열 fontname, 문자열 인코딩, bool 포함, float 크기) 오버로드를 호출 할 때 포함 된 옵션을 지정합니다. 아래의 코드는 솔루션을 찾기 위해 사용해온 테스트 코드입니다. 불행하게도 생성 된 pdf에는 임베디드 글꼴이 없습니다.글꼴이 ItextSharp에 포함되지 않음
public static void TestPDFEmbedd()
{
Document document = new Document();
PdfWriter.GetInstance(document, new FileStream(SystemPaths.SystemPath + "\\Production\\Test.pdf", FileMode.Create));
document.Open();
FontFactory.Register("c:\\windows\\fonts\\tahomabd.ttf","address_font");
Font font = FontFactory.GetFont("address_font",BaseFont.CP1252,true,10f);
document.Add(new Paragraph("Testing 123", font));
document.Close();
}
Tahoma Bold 대신 Helvetica가 표시되면 글꼴 경로가 잘못되었습니다. –