New PDF reader: set default zoom options

Use case or problem

I prefer the “Fit height” option on PDFs, and it is tiresome setting this option each time I open a PDF in the viewer.

Proposed solution

Some way to set the default zoom levels and options for all PDFs, or possibly an option to have the settings carry over between files.

Current workaround (optional)

Manually setting my preferred zoom levels each time.

Related feature requests (optional)

Could not find any.

3 Likes

Bumping this, I would prefer control over this as well.

For any interested, there is a temporary CSS snippet that works for me (see elsewhere for how to integrate CSS snippets with Obsidian in case you don’t know how):

/* Adjust the width of the main content area, only for PDF */
div[data-type="pdf"].workspace-leaf-content {
    max-width: 1480px; /* or whatever maximum width you prefer */
    margin: 0 auto; /* this centers the content pane if it's narrower than the full window */
}
1 Like

This CSS modifies the zoom level natively rather than adjusting the content area.

/* Outer container for scrolling */
div[data-type="pdf"] .pdf-viewer-scroll-container {
    overflow: auto; /* Handles scrolling */
    width: 100%; /* Adjust as needed */
    height: auto; /* Adjust based on content */
}

/* Inner container for scaling */
div[data-type="pdf"] .pdf-viewer-scroll-container .pdf-viewer-container {
    transform: scale(0.5); /* Adjust scale as needed */
    transform-origin: top center; /* Adjust origin as needed */
}

The only issue is that I don’t know how to easily fix the scroll bar overflow without JS so the scroll bar is going to be out of range of the document