File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -891,9 +891,29 @@ function PdfRequestFiles(props) {
891
891
setIsUiLoading ( true ) ;
892
892
// `widgets` is Used to return widgets details with page number of current user
893
893
const widgets = checkUser ?. [ 0 ] ?. placeHolder ;
894
-
894
+ let pdfArrBuffer ;
895
+ //`contractDocument` function used to get updated SignedUrl
896
+ // to resolve issue of widgets get remove automatically when more than 1 signers try to sign doc at a time
897
+ const documentData = await contractDocument ( documentId ) ;
898
+ if ( documentData && documentData . length > 0 ) {
899
+ const url = documentData [ 0 ] ?. SignedUrl || documentData [ 0 ] ?. URL ;
900
+ //convert document url in array buffer format to use embed widgets in pdf using pdf-lib
901
+ const arrayBuffer = await convertPdfArrayBuffer ( url ) ;
902
+ if ( arrayBuffer === "Error" ) {
903
+ setHandleError ( "Error: invalid document!" ) ;
904
+ } else {
905
+ pdfArrBuffer = arrayBuffer ;
906
+ }
907
+ } else if (
908
+ documentData === "Error: Something went wrong!" ||
909
+ ( documentData . result && documentData . result . error )
910
+ ) {
911
+ setHandleError ( "Error: Something went wrong!" ) ;
912
+ } else {
913
+ setHandleError ( "Document not Found!" ) ;
914
+ }
895
915
// Load a PDFDocument from the existing PDF bytes
896
- const existingPdfBytes = pdfArrayBuffer ;
916
+ const existingPdfBytes = pdfArrBuffer ;
897
917
try {
898
918
const pdfDoc = await PDFDocument . load ( existingPdfBytes ) ;
899
919
const isSignYourSelfFlow = false ;
You can’t perform that action at this time.
0 commit comments