Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docx, Doc file is not working i am passing base64data URI #134

Open
ManiMaran001 opened this issue Feb 22, 2024 · 0 comments
Open

Docx, Doc file is not working i am passing base64data URI #134

ManiMaran001 opened this issue Feb 22, 2024 · 0 comments

Comments

@ManiMaran001
Copy link

ManiMaran001 commented Feb 22, 2024

HI,
I am passing base64 data uri as a prop for the react document viewer package
but it working fine for the hosted azure blob storage url viewing the docx and doc file
But unfortunately i need base64data uri support to view the docx and doc file
i used these approaches but its not working for me ..
First Way----- base64data URI
data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,uioipoipo9000jk
data:application/msword;base64,uioipoipo9000jk65656hhhhhhhhhhhhhhhh454545dffffffffffffffffffffffffffffffff

Second Way----- Converting arrybuffer to bloburl
const bloburls = new Blob([arrayBuffer],{ type: 'application/docx' });
const blobUrl = URL.createObjectURL(bloburls);
const viewerUrl = https://docs.google.com/gview?url=${encodeURIComponent(blobUrl)}&embedded=true;
const pdfConversionUrl = https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(blobUrl)};

Third way --- converted docx to html page its working but docx design is not good i used some other third party package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant