|
|
@@ -1,6 +1,6 @@ |
|
|
|
import React, { useEffect, useRef, useState } from 'react'; |
|
|
|
import { useParams } from 'react-router-dom'; // Import useParams |
|
|
|
import { apiPath, GET_PDF_PATH } from "../../../auth/utils"; |
|
|
|
import { apiPath, adobeAPIKey } from "../../../auth/utils"; |
|
|
|
|
|
|
|
const PdfViewer = ({ pdfUrl, formCode }) => { |
|
|
|
const { id } = useParams(); |
|
|
@@ -45,7 +45,7 @@ const PdfViewer = ({ pdfUrl, formCode }) => { |
|
|
|
const loadAdobeSDK = () => { |
|
|
|
if (window.AdobeDC) { |
|
|
|
const adobeDCView = new window.AdobeDC.View({ |
|
|
|
clientId: '97e02339319940a28d1181b1a06076a2', |
|
|
|
clientId: `${adobeAPIKey}`, |
|
|
|
divId: 'adobe-dc-view', |
|
|
|
}); |
|
|
|
|
|
|
@@ -73,7 +73,7 @@ const PdfViewer = ({ pdfUrl, formCode }) => { |
|
|
|
window.AdobeDC.View.Enum.CallbackType.SAVE_API, |
|
|
|
async (metaData, content, options) => { |
|
|
|
try { |
|
|
|
const saveUrl = `http://localhost:8090/api/pdf2/save-pdf?clientId=${encodeURIComponent(id)}&formCode=${encodeURIComponent(formCode)}`; |
|
|
|
const saveUrl = `${apiPath}/pdf2/save-pdf?clientId=${encodeURIComponent(id)}&formCode=${encodeURIComponent(formCode)}`; |
|
|
|
console.log('Saving to:', saveUrl); |
|
|
|
console.log('Authorization header:', `Bearer ${token}`); |
|
|
|
const response = await fetch(saveUrl, { |
|
|
|