mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-22 23:52:30 +02:00
fix: issue in template flow using roate pdf page functionality
This commit is contained in:
@@ -26,7 +26,8 @@ function PdfZoom(props) {
|
||||
props.pageNumber - 1,
|
||||
props.pdfRotateBase64
|
||||
);
|
||||
props.setPdfArrayBuffer(urlDetails.arrayBuffer);
|
||||
props?.setPdfArrayBuffer &&
|
||||
props?.setPdfArrayBuffer(urlDetails.arrayBuffer);
|
||||
props.setPdfRotatese64(urlDetails.base64);
|
||||
};
|
||||
return (
|
||||
|
||||
@@ -658,7 +658,12 @@ export const randomId = () => {
|
||||
return randomDigit;
|
||||
};
|
||||
|
||||
export const createDocument = async (template, placeholders, signerData) => {
|
||||
export const createDocument = async (
|
||||
template,
|
||||
placeholders,
|
||||
signerData,
|
||||
pdfUrl
|
||||
) => {
|
||||
if (template && template.length > 0) {
|
||||
const Doc = template[0];
|
||||
|
||||
@@ -681,7 +686,7 @@ export const createDocument = async (template, placeholders, signerData) => {
|
||||
}
|
||||
const data = {
|
||||
Name: Doc.Name,
|
||||
URL: Doc.URL,
|
||||
URL: pdfUrl,
|
||||
SignedUrl: Doc.SignedUrl,
|
||||
SentToOthers: Doc.SentToOthers,
|
||||
Description: Doc.Description,
|
||||
|
||||
@@ -795,6 +795,7 @@ function SignYourSelf() {
|
||||
const signedpdf = JSON.parse(JSON.stringify(resSignPdf));
|
||||
setPdfUrl(signedpdf);
|
||||
getDocumentDetails(false);
|
||||
setPdfRotatese64("");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -917,8 +917,21 @@ const TemplatePlaceholder = () => {
|
||||
const handleCreateDocModal = async () => {
|
||||
setIsCreateDocModal(false);
|
||||
setIsCreateDoc(true);
|
||||
let pdfUrl = pdfDetails[0]?.URL;
|
||||
if (pdfRotateBase64) {
|
||||
try {
|
||||
pdfUrl = await convertBase64ToFile(pdfDetails[0].Name, pdfRotateBase64);
|
||||
} catch (e) {
|
||||
console.log("error to convertBase64ToFile in placeholder flow", e);
|
||||
}
|
||||
}
|
||||
// handle create document
|
||||
const res = await createDocument(pdfDetails, signerPos, signersdata);
|
||||
const res = await createDocument(
|
||||
pdfDetails,
|
||||
signerPos,
|
||||
signersdata,
|
||||
pdfUrl
|
||||
);
|
||||
if (res.status === "success") {
|
||||
navigate(`/placeHolderSign/${res.id}`, {
|
||||
state: { title: "Use Template" }
|
||||
|
||||
Reference in New Issue
Block a user