Skip to content

PdfView

Unofficial

View for rendering and interacting with PDF files.

Import:

import type { PdfView } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface PdfView extends EditableFileView

Extends: EditableFileView

Constructor

new PdfView(leaf: WorkspaceLeaf)

Constructor.

To extract the constructor type, use ExtractConstructor<EditableFileView>.

Properties

Property Type Description
allowNoFile boolean Whether the view may be run without an attached file..
(Inherited from EditableFileView)
file null | TFile The file that is currently being viewed.
(Inherited from EditableFileView)
fileBeingRenamed null | TFile The file that is currently being renamed.
(Inherited from EditableFileView)
navigation boolean Whether the file view can be navigated.
(Inherited from EditableFileView)
viewer unknown The PDF viewer component used to render the document.

Methods

Method Returns Description
canAcceptExtension(extension) boolean Whether the file view can accept an extension.
(Inherited from EditableFileView)
getDisplayText() string Get the display text for the file view.
(Inherited from EditableFileView)
getState() Record<string, unknown> Get the state of the file view.
(Inherited from EditableFileView)
getSyncViewState() unknown Get view state for sync plugin.
(Inherited from EditableFileView)
getViewType() typeof ViewType.Pdf Get the current view type.
loadFile(file) Promise<unknown> Loads the file with the onLoadFile function.
(Inherited from EditableFileView)
onDelete(file) Promise<void> Updates the view if it contains the deleted file.
(Inherited from EditableFileView)
onload() void Called when the file view is loaded.
(Inherited from EditableFileView)
onLoadFile(file) Promise<void> Called when the file is loaded.
(Inherited from EditableFileView)
onModify(file) void Is called when the vault has a 'modify' event. Reloads the file if the modified file is the file in this view.
onRename(file) Promise<void> Called when the file is renamed.
(Inherited from EditableFileView)
onTitleBlur() Promise<void> Is called when the titleEl looses focus.

Event type: 'blur'.
(Inherited from EditableFileView)
onTitleChange(titleEl) void Is called when the titleEl is changed.

Event type: 'input'.
(Inherited from EditableFileView)
onTitleFocus() void Is called when the titleEl gains focus.

Event type: 'focus'.
(Inherited from EditableFileView)
onTitleKeydown(event) void Is called when the titleEl is focused and a keydown is triggered.

Event type: 'keydown'.
(Inherited from EditableFileView)
onTitlePaste(titleEl, event) void Is called when the titleEl is focused and a paste event is triggered.

Event type: 'paste'.
(Inherited from EditableFileView)
onUnloadFile(file) Promise<void> Called when the file is unloaded.
(Inherited from EditableFileView)
receiveSyncState(view) void Receives sync state from another file view, opening the other view's file if it differs.
(Inherited from EditableFileView)
renderBreadcrumbs() void Render the breadcrumb navigation for this file view.
(Inherited from EditableFileView)
saveTitle(titleEl) Promise<void> Updates the file to match the updated title.
(Inherited from EditableFileView)
setState(state, result) Promise<void> Set the state of the file view.
(Inherited from EditableFileView)
showSearch() void Shows the search.
syncState(e) Promise<unknown> Synchronize the view state with the sync plugin.
(Inherited from EditableFileView)

Links to this page: