You mean if our platform offer public URL without headers?
I mean is there way for you to call the URL, pass some authorization headers in, and then retrieve a public version that allows you to embed.
I am doing exact same thing calling the URL, passed some authorization headers and it should now display pdf and if you see the row is displaying “PDF” but I guess it is binary version of pdf
I’m not aware of a way to do that. Hopefully someone else can chime in.
Thank you for all the help so far.
Not sure, but you can try creating some javascript in a javascript column that converts binary to a datauri. At the end of the day, the web embed only works with a public url or a datauri. That’s about it.
yes
Not tested, but try this.
function convertPdfToDataURI(pdfBlobOrArrayBuffer) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = function (event) {
resolve(event.target.result);
};
reader.onerror = function () {
reject("Error: Failed to read file");
};
const blob = pdfBlobOrArrayBuffer instanceof Blob
? pdfBlobOrArrayBuffer
: new Blob([pdfBlobOrArrayBuffer], { type: "application/pdf" });
reader.readAsDataURL(blob);
});
}
return await convertPdfToDataURI(p1);