Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
fix: fix the bug from deploying container
Browse files Browse the repository at this point in the history
  • Loading branch information
chuang8511 committed Sep 27, 2024
1 parent a965e45 commit f2b9fb3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion operator/document/v0/markdown_transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,15 @@ func ConvertToPDF(base64Encoded, fileExtension string) (string, error) {
base64PDF, err := encodeFileToBase64(tempPDFName)

if err != nil {
return "", fmt.Errorf("failed to encode file to base64: %w", err)
// In the different containers, we have the different versions of LibreOffice, which means the behavior of LibreOffice may be different.
// So, we need to handle the case when the generated PDF is not in the temp directory.
if fileExtension == "pdf" {
base64PDF, err := encodeFileToBase64(inputFileName)
if err != nil {
return "", fmt.Errorf("failed to encode file to base64: %w", err)
}
return base64PDF, nil
}
}
return base64PDF, nil
}

0 comments on commit f2b9fb3

Please sign in to comment.