Comments (6)
Hi @tinidoooooooog,
Could you please double check if file example.pdf
exists in your directory and is accessible with provided path. I've just checked and it looks like this on my machine
What is your use case? What would you like to build with Mercury?
@apjanusz I think we are missing docs/example/tutorial for displaying PDF in Jupyter notebooks and Mercury.
from mercury.
Thanks for quick response.
I am running Mercury using docker +nginx on my remote machine instead of on my local machine (btw, PDF viewer works normally in my local version of mercury as well)
I am doubting if the problem occurs as the IFrame function is called
Could you please give me some suggestions? Thanks!
from mercury.
Do you get error when trying to access file with some other Python code?
content = None
with open(file_path, "rb") as fin:
content = fin.read()
@apjanusz could you please check if there is a good error message if we try to access not existing pdf file.
from mercury.
In my case,
error message show up correctly file does not exist and no message pop up if existing pdf file name is given.
from mercury.
@pplonski I found the root cause to this issue. The issue comes from the Data URI limitations. In Firefox, the size limitations are looser than in Chromium-based browsers (<1.5 MB) so mr.PDF works as expected in Firefox.
It would be helpful If you can help fix this using approaches not based on data URI. Thank you!
from mercury.
I resolved the issue. By saving the file in the media
folder, one can access it via
from IPython.display import Iframe
filepath = '/app/mercury/media/abcde12331/example.pdf' # assuming this
url=os.environ.get("MERCURY_SERVER_URL"),'/'.join(filepath.split()[3:]) #extract media/abcde12331/example.pdf from {filepath}
display(Iframe(src=url,width=width, height=height))
from mercury.
Related Issues (20)
- Fail to install with pip on macOS HOT 6
- How to import a python file HOT 2
- Can't start mercury local server. HOT 4
- Add and delete notebook from REST Endpoint HOT 2
- Error while displaying a widget: `AttributeError: 'CaptureShell' object has no attribute 'kernel'` HOT 1
- how can I get the username of the currently Mercury logged-in user HOT 2
- running mercury as a standalone application in microk8s pods HOT 1
- Getting error while running tests. HOT 3
- Option to hide the RunMercury switch at the top black bar HOT 3
- Problem with displaying large output HOT 2
- Any way to programatically export .pdfs? HOT 3
- Waiting for worker... (Vanilla Docker-Compose Install) HOT 8
- Add javascript code in notebook HOT 4
- Select: missing value's string in choices throws error
- image from Jupyter notebook not showing HOT 2
- Increase version of pyppeteer dependency
- Change the order of package installation and secrets provision
- Progress bars for long-running notebooks?
- Problem Installing with PyYaml=6.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mercury.