Displaying XPS in the browser

33 views Asked by At

I've been struggling with this task for quite some time.

There is a REST API in C# (net6.0) that implements the ability to send a file upon request from the document management system. The file is sent as a byte array along with its name. There is a portal in Python (Django). The portal's functionality should request a file from the API and display it on the client side when a certain object is clicked. Files can be XPS or PDF. The problem is that in the document management system, files are mainly stored in XPS format. I use an iframe for display. Displaying PDFs works fine, but XPS files just get downloaded. What I've tried: Looking for JavaScript libraries capable of displaying XPS on the client side. Couldn't find any. Converting XPS to PDF on the API side. Partially succeeded. But in the first iteration, it turned out that I used a paid library with a 30-day trial period. The price of $400 per month is too expensive for this project. In the second iteration, I found the Notan Jhones project. This library does not convert all files. And it is written for net6.0-windows, which caused difficulties for me in creating a Docker container. And it does not fully meet the needs. Tried to implement this task in Python. But it didn't work either. How can I solve this problem and from which side to approach it? P.S. Using third-party resources or APIs for conversion or display is not possible because the documents can be commercial, which is not safe...

0

There are 0 answers