Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/OpenSign/public/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
"contact-already-exists": "Der Kontakt existiert bereits.",
"docx-error": "Wir haben derzeit Probleme mit der Verarbeitung von DOCX-Dateien. Bitte laden Sie die PDF-Datei hoch",
"docx-error-contact": "oder kontaktieren Sie uns unter support@opensignlabs.com",
"excel-error": "Wir haben derzeit Probleme mit der Verarbeitung von Excel-Dateien. Bitte laden Sie die PDF-Datei hoch",
"excel-error-contact": "oder kontaktieren Sie uns unter support@opensignlabs.com",
"agreement-note": "Hinweis: Durch Ihre Zustimmung unterzeichnen Sie das Dokument nicht sofort. Sie können das Dokument nur elektronisch einsehen. Sie haben die Möglichkeit, es vollständig zu lesen und anschließend zu entscheiden, ob Sie es unterzeichnen möchten.",
"draft-template-info-p1": "Um Ihre Vorlage öffentlich zu machen, muss sie entweder eine einzelne Rolle enthalten oder, wenn sie mehrere Rollen umfasst, müssen alle zusätzlichen Rollen bereits den Unterzeichnern zugewiesen sein. Die nicht zugewiesene öffentliche Rolle muss leer bleiben und an erster Stelle stehen.",
"visit-below-link": "Besuchen Sie den untenstehenden Link, um mehr zu erfahren -",
Expand Down
2 changes: 2 additions & 0 deletions apps/OpenSign/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
"contact-already-exists": "contact already exists.",
"docx-error": "We are currently experiencing some issues with processing DOCX files. Please upload the PDF file",
"docx-error-contact": "or contact us on support@opensignlabs.com",
"excel-error": "We are currently experiencing some issues with processing Excel files. Please upload the PDF file",
"excel-error-contact": "or contact us on support@opensignlabs.com",
"agreement-note": "Note: Agreeing to this does not mean you are signing the document immediately. This only allows you to review the document electronically. You will have the opportunity to read it in full and decide whether to sign it afterward.",
"draft-template-info-p1": "To make your template public, it must either contain a single role, or, if it includes multiple roles, all additional roles must already be assigned to signers. The unassigned public role should remain empty and must be placed in the first position.",
"visit-below-link": "Visit below link to know more -",
Expand Down
2 changes: 2 additions & 0 deletions apps/OpenSign/public/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
"contact-already-exists": "El contacto ya existe.",
"docx-error": "Actualmente estamos experimentando problemas con el procesamiento de archivos DOCX. Por favor, sube el archivo PDF",
"docx-error-contact": "o contáctanos en support@opensignlabs.com",
"excel-error": "Actualmente estamos experimentando problemas con el procesamiento de archivos Excel. Por favor, sube el archivo PDF",
"excel-error-contact": "o contáctanos en support@opensignlabs.com",
"agreement-note": "Nota: Aceptar esto no significa que esté firmando el documento de inmediato. Esto solo le permite revisar el documento electrónicamente. Tendrá la oportunidad de leerlo en su totalidad y decidir si desea firmarlo después.",
"draft-template-info-p1": "Para hacer que tu plantilla sea pública, debe contener un único rol o, si incluye múltiples roles, todos los roles adicionales deben estar ya asignados a firmantes. El rol público no asignado debe permanecer vacío y debe estar en la primera posición.",
"visit-below-link": "Visita el siguiente enlace para saber más -",
Expand Down
2 changes: 2 additions & 0 deletions apps/OpenSign/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
"contact-already-exists": "Le contact existe déjà.",
"docx-error": "Nous rencontrons actuellement des problèmes avec le traitement des fichiers DOCX. Veuillez télécharger le fichier PDF",
"docx-error-contact": "ou contactez-nous à support@opensignlabs.com",
"excel-error": "Nous rencontrons actuellement des problèmes avec le traitement des fichiers Excel. Veuillez télécharger le fichier PDF",
"excel-error-contact": "ou contactez-nous à support@opensignlabs.com",
"agreement-note": "Remarque : Accepter cela ne signifie pas que vous signez immédiatement le document. Cela vous permet uniquement de consulter le document électroniquement. Vous aurez l'opportunité de le lire entièrement et de décider ensuite si vous souhaitez le signer.",
"draft-template-info-p1": "Pour rendre votre modèle public, il doit contenir un seul rôle ou, s'il inclut plusieurs rôles, tous les rôles supplémentaires doivent déjà être attribués aux signataires. Le rôle public non attribué doit rester vide et être placé en première position.",
"visit-below-link": "Visitez le lien ci-dessous pour en savoir plus -",
Expand Down
2 changes: 2 additions & 0 deletions apps/OpenSign/public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
"contact-already-exists": "संपर्क पहले से मौजूद है।",
"docx-error": "हम वर्तमान में DOCX फ़ाइलों को संसाधित करने में कुछ समस्याओं का सामना कर रहे हैं। कृपया PDF फ़ाइल अपलोड करें",
"docx-error-contact": "या support@opensignlabs.com पर हमसे संपर्क करें",
"excel-error": "हम वर्तमान में Excel फ़ाइलों को संसाधित करने में कुछ समस्याओं का सामना कर रहे हैं। कृपया PDF फ़ाइल अपलोड करें",
"excel-error-contact": "या support@opensignlabs.com पर हमसे संपर्क करें",
"agreement-note": "ध्यान दें: इससे सहमत होने का मतलब यह नहीं है कि आप तुरंत दस्तावेज़ पर हस्ताक्षर कर रहे हैं। यह आपको केवल दस्तावेज़ की इलेक्ट्रॉनिक रूप से समीक्षा करने की अनुमति देता है। आपके पास इसे पूरा पढ़ने और बाद में हस्ताक्षर करने का निर्णय लेने का अवसर होगा।",
"draft-template-info-p1": "अपने टेम्पलेट को सार्वजनिक करने के लिए, इसमें या तो एक ही भूमिका होनी चाहिए, या, यदि इसमें कई भूमिकाएँ शामिल हैं, तो सभी अतिरिक्त भूमिकाएँ पहले से ही हस्ताक्षरकर्ताओं को सौंपी जानी चाहिए। असाइन न की गई सार्वजनिक भूमिका खाली रहनी चाहिए और उसे पहले स्थान पर रखा जाना चाहिए।",
"visit-below-link": "अधिक जानने के लिए नीचे दिए गए लिंक पर जाएं -",
Expand Down
2 changes: 2 additions & 0 deletions apps/OpenSign/public/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
"contact-already-exists": "Il contatto esiste già.",
"docx-error": "Stiamo riscontrando alcuni problemi con l'elaborazione dei file DOCX. Per favore, carica il file PDF",
"docx-error-contact": "o contattaci a support@opensignlabs.com",
"excel-error": "Stiamo riscontrando alcuni problemi con l'elaborazione dei file Excel. Per favore, carica il file PDF",
"excel-error-contact": "o contattaci a support@opensignlabs.com",
"agreement-note": "Nota: Accettare questo non significa che stai firmando immediatamente il documento. Questo ti consente solo di esaminare il documento elettronicamente. Avrai l'opportunità di leggerlo per intero e decidere successivamente se firmarlo.",
"draft-template-info-p1": "Per rendere il tuo modello pubblico, deve contenere un solo ruolo oppure, se include più ruoli, tutti i ruoli aggiuntivi devono essere già assegnati ai firmatari. Il ruolo pubblico non assegnato deve rimanere vuoto e deve essere posizionato per primo.",
"visit-below-link": "Visita il link qui sotto per saperne di più -",
Expand Down
2 changes: 2 additions & 0 deletions apps/OpenSign/public/locales/kr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
"contact-already-exists": "연락처가 이미 존재합니다.",
"docx-error": "현재 DOCX 파일 처리 중 일부 문제가 발생했습니다. PDF 파일을 업로드하세요.",
"docx-error-contact": "또는 support@opensignlabs.com으로 문의하세요.",
"excel-error": "현재 Excel 파일 처리 중 일부 문제가 발생했습니다. PDF 파일을 업로드하세요.",
"excel-error-contact": "또는 support@opensignlabs.com으로 문의하세요.",
"agreement-note": "참고: 이에 동의한다고 해서 즉시 문서에 서명하는 것은 아닙니다. 이는 단지 전자적으로 문서를 검토할 수 있도록 허용하는 것입니다. 전체를 읽고 서명 여부를 결정할 기회가 있습니다.",
"draft-template-info-p1": "템플릿을 공개하려면 단일 역할을 포함하거나 여러 역할을 포함하는 경우 모든 추가 역할이 이미 서명자에게 할당되어 있어야 합니다. 할당되지 않은 공개 역할은 비워두고 첫 번째 위치에 배치해야 합니다.",
"visit-below-link": "자세한 내용은 아래 링크를 방문하세요 -",
Expand Down
53 changes: 51 additions & 2 deletions apps/OpenSign/src/pages/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,55 @@ const Forms = (props) => {
}
return;
}
} else if (
file.type === "application/vnd.ms-excel" ||
file.type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
file.name.toLowerCase().endsWith(".xls") ||
file.name.toLowerCase().endsWith(".xlsx")
) {
try {
const baseApi = localStorage.getItem("baseUrl") || "";
const url = removeTrailingSegment(baseApi) + "/exceltopdf";
let fd = new FormData();
fd.append("file", file);
setfileload(true);
setpercentage(0);
const config = {
headers: {
"content-type": "multipart/form-data",
sessiontoken: Parse.User.current().getSessionToken()
},
signal: abortController.signal,
onUploadProgress: (progressEvent) => {
if (progressEvent.total) {
const percentCompleted = Math.round(
(progressEvent.loaded * 100) / progressEvent.total
);
setpercentage(percentCompleted);
}
}
};
const res = await axios.post(url, fd, config);
if (res.data?.url) {
const pdfRes = await axios.get(res.data.url, {
responseType: "arraybuffer"
});
pdfBuffers.push(pdfRes.data);
}
setfileload(false);
} catch (err) {
setfileload(false);
removeFile(e);
console.log("err in excel to pdf ", err);
const error =
t("excel-error");
if (err?.code === 209) {
dispatch(sessionStatus(false));
} else {
alert(error);
}
return;
}
}
}

Expand Down Expand Up @@ -784,7 +833,7 @@ const Forms = (props) => {
)}
<div className="text-xs">
<label className="block">
{`${`${t("report-heading.File")} (${t("file-type")}`}${", docx)"}`}
{`${`${t("report-heading.File")} (${t("file-type")}`}${", docx, xlsx, xls)"}`}
<span className="text-red-500 text-[13px]">*</span>
</label>
{fileupload.length > 0 ? (
Expand Down Expand Up @@ -812,7 +861,7 @@ const Forms = (props) => {
className="op-file-input op-file-input-bordered op-file-input-sm focus:outline-none hover:border-base-content w-full text-xs"
onChange={(e) => handleFileInput(e)}
ref={inputFileRef}
accept="application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/png,image/jpeg"
accept="application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,image/png,image/jpeg"
onInvalid={(e) =>
e.target.setCustomValidity(t("input-required"))
}
Expand Down
2 changes: 2 additions & 0 deletions apps/OpenSignServer/cloud/customRoute/customApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import cors from 'cors';
import dotenv from 'dotenv';

import docxtopdf, { upload as docxUpload } from './docxtopdf.js';
import exceltopdf, { upload as excelUpload } from './exceltopdf.js';
import decryptpdf, { upload as decryptUpload } from './decryptpdf.js';
import { deleteUserByAdmin, deleteUserPost } from './deleteAccount/deleteUser.js';
import { deleteUserGet } from './deleteAccount/deleteUserGet.js';
Expand All @@ -16,6 +17,7 @@ app.use(express.json({ limit: '100mb' }));
app.use(express.urlencoded({ limit: '100mb', extended: true }));

app.post('/docxtopdf', docxUpload.single('file'), docxtopdf);
app.post('/exceltopdf', excelUpload.single('file'), exceltopdf);
app.post('/decryptpdf', decryptUpload.single('file'), decryptpdf);
app.get('/delete-account/:userId', deleteUserGet);
app.post('/delete-account/:userId/otp', deleteUserOtp);
Expand Down
3 changes: 2 additions & 1 deletion apps/OpenSignServer/cloud/customRoute/docxtopdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export default async function docxtopdf(req, res) {

// ---- DOCX -> PDF conversion with concurrency control and timeout ----
const fileName = `${generatePdfName(16)}.pdf`;
const uploadedSizeBytes = req.file.buffer.length;

// Adjust timeout based on file size
const timeoutMs = uploadedSizeBytes > 10 * 1024 * 1024 ? 120_000 : 90_000;
Expand Down Expand Up @@ -216,6 +217,6 @@ export default async function docxtopdf(req, res) {
msg = message;
}
console.error(`[DOCX2PDF] Error: ${msg}`);
return res.status(400).json({ error: message });
return res.status(400).json({ error: msg });
}
}
Loading