본문 바로가기
728x90

gofpdf3

[FPDF] Failed to initialize parser: Failed to read pdf: Failed to read xref table: Expected xref to start with ‘xref’. Got: 103 GoFPDF로 PDF template을 import 하려고 하는데 계속 이런 에러가 발생했다. > Failed to initialize parser: Failed to read pdf: Failed to read xref table: Expected xref to start with ‘xref’. Got: 103 https://github.com/phpdave11/gofpdi/issues/16 Failed to initialize parser: Failed to read pdf: Failed to read xref table: Expected xref to start with 'xref' · Issue #16 · p Certain formats of PDF documents do not contain t.. 2022. 9. 7.
[FPDF] 한글 처리 Golang으로 PDF 템플릿을 받아서 서버에서 받아온 데이터를 찍는 프로젝트를 하고 있다. 지금은 fpdf.SetFont("Arial", "", 12) pdf.SetFont("times", "", 22) 이런 식으로 글꼴을 받고 있다. 여기서 잠깐!! "Arial", "times" 폰트는 원래 제공해주는 폰트인데 한글 한글은 지원이 안 된다. 그래서 한글 폰트를 다운로드하여서 적용해줬다. 나는 이 폰트를 다운로드하여서 적용시켰다. 많은 글꼴 중에 "AppleSDGothicNeoM"을 넣고 싶다 하면 일단 자신의 프로젝트 경로를 잘 설정해서 글꼴 파일을 넣어주고 (AppleSDGothicNeoM.ttf) // ttf 파일 등록. 경로 유의 pdf.AddUTF8Font("AppleSDGothicNeoM",.. 2022. 8. 9.
[FPDF] MultiCell()을 활용한 개행(줄바꿈) 처리 Go언어로 PDF 템플릿을 받아서 서버에서 받아온 데이터를 찍는 프로젝트를 하고 있다. 지금은 pdf.Text()를 쓰고 있어서 긴 문장을 받아오면 자동으로 개행 처리가 안 되고 PDF 템플릿 밖으로 넘어간다. 어떻게 하면 개행 처리를 할 수 있을지 찾아보다가 MultiCell()을 발견했다!! https://java-coding.tistory.com/49 [FPDF] MultiCell MultiCell(float w, float h, string txt [, mixed border [, string align [, boolean fill]]]) http://www.fpdf.org/en/doc/multicell.htm MultiCell www.fpdf.org 🌸 Description (설명) - Mult.. 2022. 8. 9.
728x90