fix: normalize pdf font path
This commit is contained in:
@@ -17,14 +17,17 @@ func resolvePdfAssetPath(name string) (string, error) {
|
|||||||
return "", fmt.Errorf("env PDF_FONT_DIR not set")
|
return "", fmt.Errorf("env PDF_FONT_DIR not set")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 반드시 absolute olmalı
|
// Absolute yap
|
||||||
if !filepath.IsAbs(base) {
|
base, err := filepath.Abs(base)
|
||||||
return "", fmt.Errorf("PDF_FONT_DIR is not absolute: %s", base)
|
if err != nil {
|
||||||
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
full := filepath.Join(base, name)
|
full := filepath.Join(base, name)
|
||||||
|
|
||||||
// Mutlaka dosya var mı kontrol et
|
// Debug log
|
||||||
|
fmt.Println("PDF FONT PATH:", full)
|
||||||
|
|
||||||
if _, err := os.Stat(full); err != nil {
|
if _, err := os.Stat(full); err != nil {
|
||||||
return "", fmt.Errorf("font not found: %s (%v)", full, err)
|
return "", fmt.Errorf("font not found: %s (%v)", full, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user