summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/file-manager/FileManager.tsx9
-rw-r--r--components/file-manager/SecurePDFViewer.tsx10
-rw-r--r--components/file-manager/creaetWaterMarks.tsx8
3 files changed, 18 insertions, 9 deletions
diff --git a/components/file-manager/FileManager.tsx b/components/file-manager/FileManager.tsx
index 1af29e74..11f58980 100644
--- a/components/file-manager/FileManager.tsx
+++ b/components/file-manager/FileManager.tsx
@@ -852,6 +852,15 @@ export function FileManager({ projectId }: FileManagerProps) {
// View file with PDFTron
const viewFile = async (file: FileItem) => {
try {
+ const mimeType = file.mimeType || '';
+ const fileName = file.name.toLowerCase();
+
+ if (mimeType.startsWith('text/') ||
+ mimeType.endsWith('.txt')) {
+ window.open(`/api/files/${file.filePath}`, `_blank`);
+ return;
+ }
+
setViewerFileUrl(file.filePath || '');
setSelectedFile(file);
setViewerDialogOpen(true);
diff --git a/components/file-manager/SecurePDFViewer.tsx b/components/file-manager/SecurePDFViewer.tsx
index eeb59b83..bd28214b 100644
--- a/components/file-manager/SecurePDFViewer.tsx
+++ b/components/file-manager/SecurePDFViewer.tsx
@@ -192,7 +192,7 @@ export function SecurePDFViewer({ documentUrl, fileName, onClose }: SecurePDFVie
setIsLoading(false);
// 워터마크 추가
- const watermarkText = `${session?.user?.email || 'CONFIDENTIAL'}\n${new Date().toLocaleString()}`;
+ const watermarkText = `SHI DATAROOM\n${session?.user?.email || 'CONFIDENTIAL'}\n${new Date().toLocaleString()}`;
// 대각선 워터마크
documentViewer.setWatermark({
@@ -200,8 +200,8 @@ export function SecurePDFViewer({ documentUrl, fileName, onClose }: SecurePDFVie
text: watermarkText,
fontSize: 14,
fontFamily: 'Arial',
- color: 'rgba(128, 128, 128, 0.15)', // 연한 회색
- opacity: 15, // 15% 투명도
+ color: 'rgba(128, 128, 128, 0.3)', // 연한 회색
+ opacity: 30, // 15% 투명도
rotation: -45,
})
});
@@ -222,8 +222,8 @@ export function SecurePDFViewer({ documentUrl, fileName, onClose }: SecurePDFVie
watermarkAnnot.setContents(
`${session?.user?.email}\n${docFileName}\n${new Date().toLocaleDateString()}`
);
- watermarkAnnot.FillColor = new instance.Core.Annotations.Color(255, 0, 0, 0.1);
- watermarkAnnot.TextColor = new instance.Core.Annotations.Color(255, 0, 0, 0.3);
+ watermarkAnnot.FillColor = new instance.Core.Annotations.Color(255, 0, 0, 0.3);
+ watermarkAnnot.TextColor = new instance.Core.Annotations.Color(255, 0, 0, 0.4);
watermarkAnnot.FontSize = '24pt';
watermarkAnnot.TextAlign = 'center';
watermarkAnnot.Rotation = -45;
diff --git a/components/file-manager/creaetWaterMarks.tsx b/components/file-manager/creaetWaterMarks.tsx
index a9072150..ebf4322e 100644
--- a/components/file-manager/creaetWaterMarks.tsx
+++ b/components/file-manager/creaetWaterMarks.tsx
@@ -1,8 +1,8 @@
export const createCustomWatermark: CreateCustomWatermark = ({
text,
fontSize = 14,
- color = "rgba(128, 128, 128, 0.15)", // 더 연한 회색, 더 투명하게
- opacity = 15, // 더 낮은 opacity
+ color = "rgba(128, 128, 128, 0.3)", // 더 연한 회색, 더 투명하게
+ opacity = 30, // 더 낮은 opacity
rotation = -45,
fontFamily = "Arial",
}) => {
@@ -30,8 +30,8 @@ export const createCustomWatermark: CreateCustomWatermark = ({
const textBlockHeight = lines.length * lineHeight;
// 격자 간격 계산 (텍스트 블록 크기 기반)
- const horizontalSpacing = maxLineWidth * 1.8; // 가로 간격
- const verticalSpacing = textBlockHeight * 2.5; // 세로 간격
+ const horizontalSpacing = maxLineWidth * 0.8; // 가로 간격
+ const verticalSpacing = textBlockHeight * 1.5; // 세로 간격
// 회전을 고려한 대각선 길이 계산
const diagonal = Math.sqrt(pageWidth * pageWidth + pageHeight * pageHeight);