2012-06-22 5 views
4

PDFKit 및 사용자 정의 글꼴로 pdf를 인쇄하는 방법이 있습니까? CSS에서PDFKIT 사용자 정의 글꼴

는 내가 가진 : 표준 글꼴을 사용 PDFKit와 PDF로 HTML 만 인쇄로 렌더링 할 때 코드 위

@font-face { 
font-family: 'ChaparralProRegular'; 
src: url("path_to_font/chaparralpro-regular-webfont.eot"); 
src: url("path_to_font/chaparralpro-regular-webfont.eot?#iefix") format("embedded-opentype"), 
url("path_to_font/chaparralpro-regular-webfont.woff") format("woff"), 
url("path_to_font/chaparralpro-regular-webfont.ttf") format("truetype"), 
url("path_to_font/chaparralpro-regular-webfont.svg#ChaparralProRegular") format("svg"); 

가 잘 작동합니다. 실마리가 있습니까?

+0

JFI가 한 당신은 당신의 스타일 시트와 미디어 화면을 제공하며 옵션은 내가 pdfkit도 지원을 추측 스타일 시트를 부착 wkthmltopdf''에서 스타일 시트를 부착 할 수있다 it, yes 그렇습니다'kit.stylesheets << '/ path_to_your_stylesheet' – Viren

답변

1

당신의 pdfkit에서 글꼴 파일의 위치를 ​​찾을 수 없을 것 같습니다. 나는 pdf에있는 심상을 가진 동일한 문제점이 있었다. 로컬 파일 경로를 글꼴 파일에 대한 모든 URL을 대체하려고 :

url("#{Rails.root}/path_to_font/chaparralpro-regular-webfont.eot"); 
+0

글꼴을 위해 작동하지 않습니다 – jbmyid

+0

글꼴을 위해 작동하지 않습니다 .. – shajin