Steps to reproduce
Embed a PDF file ( that contains a cropped 1st page ) in a note.
When I open the note, the PDF viewer would show me the 1st page of the PDF file.
When I open the note, the PDF viewer shows me the 2nd page of the PDF file.
Obsidian version: v1.3.5
Installer version: v1.3.3
Operating system: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 22.5.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on
This test PDF file can be used to reproduce this issue.
Does it happen with all PDFs or with this specific one?
It happens with all PDFs that have a cropped 1st page.
Here is another example with 2 versions of the same PDF file:
Uncropped PDF - shows Page 1 when the note opens.
Cropped PDF - shows Page 12 when the note opens.
This seems to be a problem with pdf.js.
Search/open a bug report upstream https://mozilla.github.io/pdf.js/
The reason I have to crop the 1st page is that the PDF viewer box is the same size as the 1st page. Because some of my PDF files have really long pages, that makes it not so nice because it takes up a lot of space in the note.
Is there a way to limit the height of the PDF viewer box in the note (so that only part of the 1st page shows upon opening the note?
No I am sorry but you should not involve Obsidian in this bug report. You need to file a bug report following their guidelines a d reproducing using their demo page (which I did). They are not gonna consider that bug report that you wrote.
Can you please share the link to your bug report? I am not able to find it.
I did not file a bug report, but i did test on their demo page and it happens there as well.
Okay, got it.
Is there a way to limit the height of the PDF viewer box in an Obsidian note (so that only part of the 1st page shows upon opening the note?
you can try with some css.
I do not see any CSS variables listed for the PDF viewer in Obsidian’s documentation.
CSS variables - Developer Documentation
Can you please point me to where they are listed?
The best place to ask for help regarding css is on discord on in the help section of the forum
Can you please share the direct link to the demo page where you tried it?
I checked here PDF.js viewer, but it only shows a preloaded PDF file. I am not able to open a PDF file from my computer.
Also, I dowloaded the latest version of Firefox that has PDF.js built in and was not able to reproduce this issue.