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: toggle color inversion for all viewers.Commands available in .pdf-viewer:
pdf-viewer:refresh: refresh content for the current viewer,pdf-viewer:toggle-refreshing: toggle auto-refresh for the current viewer,pdf-viewer:invert-current: invert colors for the current viewer,pdf-viewer:compile: compile the source .typ or .tex file,pdf-viewer:open-tex: open the corresponding .typ or .tex source file,pdf-viewer:next-page: go to the next page,pdf-viewer:previous-page: go to the previous page,pdf-viewer:first-page: go to the first page,pdf-viewer:last-page: go to the last page,pdf-viewer:scroll-up: scroll up,pdf-viewer:scroll-down: scroll down,pdf-viewer:scroll-left: scroll left,pdf-viewer:scroll-right: scroll right,pdf-viewer:page-up: scroll up by one viewport,pdf-viewer:page-down: scroll down by one viewport,pdf-viewer:zoom-in: zoom in,pdf-viewer:zoom-out: zoom out,pdf-viewer:zoom-reset: reset zoom,pdf-viewer:rotate-clockwise: rotate clockwise,pdf-viewer:rotate-counterclockwise: rotate counterclockwise,pdf-viewer:select-tool: enable the text selection tool,pdf-viewer:hand-tool: enable the hand tool,pdf-viewer:find: open find,pdf-viewer:find-next: find next match,pdf-viewer:find-previous: find previous match,pdf-viewer:copy: copy the selected text to the clipboard,pdf-viewer:toggle-sidebar: toggle the PDF sidebar,pdf-viewer:presentation-mode: enter presentation mode,pdf-viewer:download: download the PDF,pdf-viewer:print: print the PDF.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 via the navigation-adapter service. You can search through the document using the all-in outline tree instead of the PDFjs outline. Scroll position is tracked and the active section is highlighted in the panel.
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');
}
navigation-adapterExposes the PDF document outline to navigation-panel. Registers automatically when both packages are installed.
In your package.json:
{
"consumedServices": {
"navigation-adapter": {
"versions": {
"1.0.0": "consumeNavigationAdapter"
}
}
}
}
In your main module:
consumeNavigationAdapter(adapter) {
// adapter follows the navigation-adapter protocol:
// handlesItem(item), observeHeaders(item, callback), navigateTo(item, header)
}
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!