pdf-viewer

PDF viewer based on PDF.js

bacadra

584

1

0.2.2

MIT

GitHub

pdf-viewer

Latest OpenIssues Language Licence

title-pic

The pdf-viewer package is a PDF viewer for Pulsar. It is a wrapper around Mozilla's PDF.js library, including its viewer application, adapted for the Pulsar environment.

PDF files can be opened from the Pulsar user interface, such as from the project tree view, or programmatically using atom.workspace.open(uri). The package watches for file changes and reloads the PDF if necessary. Viewer panes are persistent across Pulsar runs. The uri consists of the filepath and optional parameters.

Installation

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 bacadra/pulsar-pdf-viewer to install a package directly from the Github repository.

Keyboard shortcuts

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:

Style

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 F8 while viewing an active file.

dark-mode

Document outline

The viewer supports the navigation-panel package. You can search through the document using the all-in outline tree instead of the PDFjs outline.

URI options

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.

LaTeX

This package supports SyncTeX for .tex and .pdf files in both directions. To go from a .tex file to a .pdf file, use the pdf-viewer:synctex command from the command palette. To go from a .pdf file to a .tex file, right-click on the desired location in the PDF.

For PDF files created by TeX using the --synctex=1 option, clicking on the PDF will take you to the corresponding source code. If the synctex command (part of modern TeX distributions) is in your PATH, this functionality will work out of the box. Otherwise, you can configure the path to the synctex binary in the package settings.

The viewer can remember the page before a refresh and set it as the initial page after the refresh.

latex-synctex

SOFiSTiK

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.

Contributing 🍺

If you have any ideas on how to improve the package, spot any bugs, or would like to support the development of new features, please feel free to share them via GitHub.