This package provides:
This package consumes:
View PDF files directly in Pulsar. Based on Mozilla's PDF.js with theme integration, SyncTeX support, and document outline.

.tex files and SyncTeX support via latex-tools..typ files via typst-tools.To install pdf-viewer search for pdf-viewer in the Install pane of the Pulsar settings or run ppm install pdf-viewer. Alternatively, you can run ppm install asiloisad/pulsar-pdf-viewer to install a package directly from the GitHub repository.
Commands available in atom-workspace:
pdf-viewer:reload-all: reload all open PDF viewers,pdf-viewer:invert-mode: F8 toggle color inversion for all viewers.Commands available in .pdf-viewer:
pdf-viewer:compile: F12 compile the source .typ or .tex file,pdf-viewer:open-tex: open the corresponding .typ or .tex source file.The keyboard shortcuts within the PDF.js viewer remain unchanged and cannot be modified from within Pulsar. For more information, refer to the default keymap:
After showing the sidebar, click on the "Show document outline" button to display the document outline (if the PDF file has one). Nested outline items can be expanded/collapsed by clicking on the triangles to the left of an item. To expand/collapse all items under the selected item, press Shift while clicking on the triangle. Double-click on the "Show document outline" button to expand/collapse all outline items.
Additional keyboard shortcuts have been introduced:
Some keymap of external packages have been implemented:
.tex source): RightClick.The style of the documents has been adapted to match the theme in Pulsar. As the style changes, you may notice the menu colors change. An additional option has been introduced to invert the colors of the document itself. To invert the document colors, change the options in the package settings, use pdf-viewer:invert-mode from the command palette, or press keybind while viewing an active file.

The viewer supports the navigation-panel package. You can search through the document using the all-in outline tree instead of the PDFjs outline.
The package supports additional options when opening a PDF. These options allow you to open a PDF on a specific page, set the initial zoom level, open the file to a named destination, or select a sidebar state. For more information, see pdf.js viewer options.
This package integrates with latex-tools for compilation and SyncTeX support:
.tex file.For PDF files created by TeX using the --synctex=1 option, clicking on the PDF will take you to the corresponding source code. The synctex binary path can be configured in the latex-tools package settings.
This package integrates with typst-tools for compilation:
.typ file.pdf-viewer:open-tex to open the .typ source file.When both .typ and .tex source files exist, the Typst source takes priority.
This package is adapted to support sofistik-tools for help functions using search keywords at the current scope. For more information, see the sofistik-tools package.
pdf-viewerAllows other packages to manage PDF viewers programmatically. Open PDFs, observe viewer instances, scroll to destinations, and update viewer files.
In your package.json:
{
"consumedServices": {
"pdf-viewer": {
"versions": {
"1.0.0": "consumePdfViewer"
}
}
}
}
In your main module:
consumePdfViewer(service) {
// Observe all viewers (existing and new)
this.subscriptions.add(
service.observeViewers((viewer) => {
console.log(`Viewer opened: ${viewer.filePath}`);
})
);
// Open a PDF in a split pane
service.open('/path/to/file.pdf', {
split: 'right',
dest: 'chapter1',
activatePane: false,
});
// Find a viewer by file path
const viewer = service.getViewerByPath('/path/to/file.pdf');
// Scroll to a named destination
service.scrollToDestination(viewer, 'section2');
}
| Method | Description |
|---|---|
getViewers() |
Returns the Set of all active viewer instances. |
observeViewers(callback) |
Calls callback for existing and future viewers. Returns a Disposable. |
getViewerByPath(filePath) |
Finds a viewer by PDF file path. Returns Viewer or null. |
getViewerByTag(tag) |
Finds a viewer whose hash contains the given tag. Returns Viewer or null. |
open(filePath, options?) |
Opens a PDF. Options: split, dest, tag, activatePane. Returns Promise<Viewer>. |
scrollToDestination(viewer, dest) |
Scrolls an existing viewer to a named destination. |
setFile(viewer, filePath, dest?, tag?) |
Updates a viewer to show a different PDF file. |
Got ideas to make this package better, found a bug, or want to help add new features? Just drop your thoughts on GitHub. Any feedback is welcome!